include/svtools/valueset.hxx                     |    3 
 sd/source/ui/animations/SlideTransitionPane.cxx  |  221 +++++++++++++----------
 sd/source/ui/inc/SlideTransitionPane.hxx         |   25 --
 sd/uiconfig/simpress/ui/slidetransitionspanel.ui |   54 ++---
 svtools/source/control/valueset.cxx              |   18 +
 5 files changed, 190 insertions(+), 131 deletions(-)

New commits:
commit f162ca73db2d81e798020214eb0256bd055e98dc
Author:     Xisco Fauli <[email protected]>
AuthorDate: Tue Sep 2 10:58:51 2025 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Sep 3 12:59:32 2025 +0200

    tdf#167753: Revert "slideshow: change transition drawing view to icon view"
    
    This reverts commit e4a1c45a0bad3677d0b131ef9c6ac6e3c4bdb03c.
    
    This patch also reverts a part of
    commit 5c4fac1e9f50832852e87452f3152f01b905f9e6
    Author: Noel Grandin <[email protected]>
    Date:   Wed Oct 16 13:19:05 2024 +0200
    
        loplugin:unusedmethods
    
    since some methods are needed now
    
    Change-Id: If2610349ac1aaecb03d1a2f1b6e3e8005c23eb77
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190538
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    (cherry picked from commit 654a6dd03dc687ddca67d09e69b3d47c32e7faeb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190554
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Xisco Fauli <[email protected]>

diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index 2244dfc805af..2bece77a8773 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -265,6 +265,7 @@ private:
 
 protected:
     virtual css::uno::Reference<css::accessibility::XAccessible> 
CreateAccessible() override;
+    weld::ScrolledWindow* GetScrollBar() const { return 
mxScrolledWindow.get(); }
 
 public:
     ValueSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow);
@@ -351,6 +352,8 @@ public:
     }
     sal_uInt16 GetHighlightedItemId() const { return mnHighItemId; }
 
+    void            RecalculateItemSizes();
+
     void            SetItemImage( sal_uInt16 nItemId, const Image& rImage );
     Image           GetItemImage( sal_uInt16 nItemId ) const;
     void            SetItemColor( sal_uInt16 nItemId, const Color& rColor );
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx 
b/sd/source/ui/animations/SlideTransitionPane.cxx
index 1ab9ca44ab0c..1b4dacde64e1 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -211,9 +211,6 @@ struct TransitionEffect
 
 } // namespace sd::impl
 
-namespace sd
-{
-
 // Local Helper Functions
 namespace
 {
@@ -345,20 +342,53 @@ void lcl_FillSoundListBox(
 }
 
 /// Returns an offset into the list of transition presets
-sd::TransitionPresetPtr getPreset(const sd::impl::TransitionEffect &rEffect)
+size_t getPresetOffset( const sd::impl::TransitionEffect &rEffect )
 {
-    const sd::TransitionPresetList& rPresetList = 
sd::TransitionPreset::getTransitionPresetList();
+    const sd::TransitionPresetList& rPresetList =
+        sd::TransitionPreset::getTransitionPresetList();
 
-    for (const auto& pPreset: rPresetList)
+    size_t nIdx = 0;
+    for( const auto& aIt: rPresetList )
     {
-        if (rEffect.operator==(*pPreset))
-            return pPreset;
+        if( rEffect.operator==( *aIt ))
+            break;
+        nIdx++;
     }
-    return sd::TransitionPresetPtr();
+    return nIdx;
 }
 
 } // anonymous namespace
 
+namespace sd
+{
+
+class TransitionPane : public ValueSet
+{
+public:
+    explicit TransitionPane(std::unique_ptr<weld::ScrolledWindow> 
pScrolledWindow)
+        : ValueSet(std::move(pScrolledWindow))
+    {
+    }
+
+    void Recalculate()
+    {
+        GetScrollBar()->set_vpolicy(VclPolicyType::AUTOMATIC);
+        RecalculateItemSizes();
+    }
+
+    virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
+    {
+        Size aSize = pDrawingArea->get_ref_device().LogicToPixel(Size(70, 88), 
MapMode(MapUnit::MapAppFont));
+        pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
+        ValueSet::SetDrawingArea(pDrawingArea);
+        SetOutputSizePixel(aSize);
+
+        SetStyle(GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL);
+        EnableFullItemMode( false );
+        SetColCount(3);
+    }
+};
+
 // SlideTransitionPane
 SlideTransitionPane::SlideTransitionPane(
     weld::Widget* pParent,
@@ -366,8 +396,6 @@ SlideTransitionPane::SlideTransitionPane(
         PanelLayout( pParent, u"SlideTransitionsPanel"_ustr, 
u"modules/simpress/ui/slidetransitionspanel.ui"_ustr ),
         mrBase( rBase ),
         mpDrawDoc( rBase.GetDocShell() ? rBase.GetDocShell()->GetDoc() : 
nullptr ),
-        mxTransitionsIconView(m_xBuilder->weld_icon_view("transitions_icons")),
-        
mxTransitionsScrollWindow(m_xBuilder->weld_scrolled_window("transitions_icons_scrolled_window")),
         mxRepeatAutoFrame(m_xBuilder->weld_frame("repeat_after_frame")),
         mbHasSelection( false ),
         mbUpdatingControls( false ),
@@ -383,6 +411,8 @@ css::ui::LayoutSize 
SlideTransitionPane::GetHeightForWidth(const sal_Int32 /*nWi
     return css::ui::LayoutSize(nMinimumHeight, -1, nMinimumHeight);
 }
 
+constexpr sal_uInt16 nNoneId = std::numeric_limits<sal_uInt16>::max();
+
 void SlideTransitionPane::Initialize(SdDrawDocument* pDoc)
 {
     mxLB_VARIANT = m_xBuilder->weld_combo_box(u"variant_list"_ustr);
@@ -409,12 +439,22 @@ void SlideTransitionPane::Initialize(SdDrawDocument* pDoc)
     mxMF_REPEAT_AUTO_AFTER->set_width_chars(nWidthChars);
     mxCBX_duration->set_width_chars(nWidthChars);
 
+    mxVS_TRANSITION_ICONS.reset(new 
TransitionPane(m_xBuilder->weld_scrolled_window(u"transitions_iconswin"_ustr, 
true)));
+    mxVS_TRANSITION_ICONSWin.reset(new weld::CustomWeld(*m_xBuilder, 
u"transitions_icons"_ustr, *mxVS_TRANSITION_ICONS));
+
     if( pDoc )
         mxModel = pDoc->getUnoModel();
     // TODO: get correct view
     if( mxModel.is())
         mxView.set( mxModel->getCurrentController(), uno::UNO_QUERY );
 
+    // dummy list box of slide transitions for startup.
+    mxVS_TRANSITION_ICONS->InsertItem(
+        nNoneId, Image( StockImage::Yes, u"sd/cmd/transition-none.png"_ustr ),
+        SdResId( STR_SLIDETRANSITION_NONE ),
+        VALUESET_APPEND, /* show legend */ true );
+    mxVS_TRANSITION_ICONS->Recalculate();
+
     // set defaults
     mxCB_AUTO_PREVIEW->set_active(true);      // automatic preview on
 
@@ -425,7 +465,7 @@ void SlideTransitionPane::Initialize(SdDrawDocument* pDoc)
     mxPB_APPLY_TO_ALL->connect_clicked( LINK( this, SlideTransitionPane, 
ApplyToAllButtonClicked ));
     mxPB_PLAY->connect_clicked( LINK( this, SlideTransitionPane, 
PlayButtonClicked ));
 
-    mxTransitionsIconView->connect_item_activated(LINK(this, 
SlideTransitionPane, TransitionSelected));
+    mxVS_TRANSITION_ICONS->SetSelectHdl( LINK( this, SlideTransitionPane, 
TransitionSelected ));
 
     mxLB_VARIANT->connect_changed( LINK( this, SlideTransitionPane, 
VariantListBoxSelected ));
     mxCBX_duration->connect_value_changed(LINK( this, SlideTransitionPane, 
DurationModifiedHdl));
@@ -453,8 +493,8 @@ SlideTransitionPane::~SlideTransitionPane()
 {
     maLateInitTimer.Stop();
     removeListener();
-    mxTransitionsScrollWindow.reset();
-    mxTransitionsIconView.reset();
+    mxVS_TRANSITION_ICONSWin.reset();
+    mxVS_TRANSITION_ICONS.reset();
     mxRepeatAutoFrame.reset();
     mxLB_VARIANT.reset();
     mxCBX_duration.reset();
@@ -538,16 +578,16 @@ void SlideTransitionPane::updateControls()
     if( aEffect.mbEffectAmbiguous )
     {
         SAL_WARN( "sd.transitions", "Unusual, ambiguous transition effect" );
-        mxTransitionsIconView->select(0);
+        mxVS_TRANSITION_ICONS->SelectItem(nNoneId);
     }
     else
     {
-         // ToDo: That 0 is "no transition" is documented nowhere except in the
+        // ToDo: That 0 is "no transition" is documented nowhere except in the
         // CTOR of sdpage
         if( aEffect.mnType == 0 )
-            mxTransitionsIconView->select(0);
+            mxVS_TRANSITION_ICONS->SelectItem(nNoneId);
         else
-            updateVariants(getPreset(aEffect));
+            updateVariants( getPresetOffset( aEffect ) );
     }
 
     if( aEffect.mbDurationAmbiguous )
@@ -645,8 +685,7 @@ void SlideTransitionPane::updateControls()
 
 void SlideTransitionPane::updateControlState()
 {
-    if (mxTransitionsScrollWindow)
-        mxTransitionsScrollWindow->set_sensitive(mbHasSelection);
+    mxVS_TRANSITION_ICONSWin->set_sensitive( mbHasSelection );
     mxLB_VARIANT->set_sensitive( mbHasSelection && mxLB_VARIANT->get_count() > 
0 );
     mxCBX_duration->set_sensitive( mbHasSelection );
     mxLB_SOUND->set_sensitive( mbHasSelection );
@@ -749,34 +788,34 @@ impl::TransitionEffect 
SlideTransitionPane::getTransitionEffectFromControls() co
     impl::TransitionEffect aResult;
     aResult.setAllAmbiguous();
 
-    OUString sSelectedId = mxTransitionsIconView->get_selected_id();
-    auto* pTransitionEntry = weld::fromId<TransitionEntry*>(sSelectedId);
-    if (!pTransitionEntry)
-        return aResult;
-
-    const sd::TransitionPresetList& rPresetList = 
sd::TransitionPreset::getTransitionPresetList();
+    bool bNoneSelected = mxVS_TRANSITION_ICONS->IsNoSelection() || 
mxVS_TRANSITION_ICONS->GetSelectedItemId() == nNoneId;
 
-    if (pTransitionEntry->mpPreset)
+    // check first (aResult might be overwritten)
+    if(  mxVS_TRANSITION_ICONSWin->get_sensitive() &&
+        !bNoneSelected &&
+         mxVS_TRANSITION_ICONS->GetSelectedItemId() > 0 )
     {
-        auto pSelectedPreset = pTransitionEntry->mpPreset;
+        const sd::TransitionPresetList& rPresetList = 
sd::TransitionPreset::getTransitionPresetList();
+        auto aSelected = rPresetList.begin();
+        std::advance( aSelected, mxVS_TRANSITION_ICONS->GetSelectedItemId() - 
1);
 
         if (mxLB_VARIANT->get_active() == -1)
         {
             // Transition with just one effect.
-            aResult = impl::TransitionEffect(*pSelectedPreset);
+            aResult = impl::TransitionEffect( **aSelected );
             aResult.setAllAmbiguous();
         }
         else
         {
             int nVariant = 0;
             bool bFound = false;
-            for(const auto& rPreset: rPresetList)
+            for( const auto& aIter: rPresetList )
             {
-                if (rPreset->getSetId() == pSelectedPreset->getSetId() )
+                if( aIter->getSetId() == (*aSelected)->getSetId() )
                 {
                     if( mxLB_VARIANT->get_active() == nVariant)
                     {
-                        aResult = impl::TransitionEffect(*rPreset);
+                        aResult = impl::TransitionEffect( *aIter );
                         aResult.setAllAmbiguous();
                         bFound = true;
                         break;
@@ -794,7 +833,7 @@ impl::TransitionEffect 
SlideTransitionPane::getTransitionEffectFromControls() co
         }
         aResult.mbEffectAmbiguous = false;
     }
-    else
+    else if (bNoneSelected)
     {
         aResult.mbEffectAmbiguous = false;
     }
@@ -1011,45 +1050,53 @@ IMPL_LINK_NOARG(SlideTransitionPane, PlayButtonClicked, 
weld::Button&, void)
     playCurrentEffect();
 }
 
-IMPL_LINK_NOARG(SlideTransitionPane, TransitionSelected, weld::IconView&, bool)
+IMPL_LINK_NOARG(SlideTransitionPane, TransitionSelected, ValueSet*, void)
 {
-    OUString sSelectedId = mxTransitionsIconView->get_selected_id();
-    auto* pTransitionEntry = weld::fromId<TransitionEntry*>(sSelectedId);
-    updateVariants(pTransitionEntry->mpPreset);
+    updateVariants( mxVS_TRANSITION_ICONS->GetSelectedItemId() - 1 );
     applyToSelectedPages();
-    return true;
 }
 
 /// we use an integer offset into the list of transition presets
-void SlideTransitionPane::updateVariants(TransitionPresetPtr const& pPreset)
+void SlideTransitionPane::updateVariants( size_t nPresetOffset )
 {
+    const sd::TransitionPresetList& rPresetList = 
sd::TransitionPreset::getTransitionPresetList();
     mxLB_VARIANT->clear();
-    mxLB_VARIANT->set_sensitive(false);
-    mxLB_VARIANT->set_active(0);
+    mxVS_TRANSITION_ICONS->SelectItem(nNoneId);
 
-    if (!pPreset)
+    if( nPresetOffset >= rPresetList.size() )
     {
-        mxTransitionsIconView->select(0);
+        mxLB_VARIANT->set_sensitive( false );
     }
     else
     {
-        auto iterator = maTranstionMap.find(pPreset->getSetId());
-        if (iterator != maTranstionMap.end())
+        auto pFound = rPresetList.begin();
+        std::advance( pFound, nPresetOffset );
+
+        // Fill in the variant listbox
+        size_t nFirstItem = 0, nItem = 1;
+        for( const auto& aIt: rPresetList )
         {
-            auto& pTransitionEntry = iterator->second;
-            if (!pTransitionEntry->mnVariants.empty())
+            if( aIt->getSetId() == (*pFound)->getSetId() )
             {
-                for (OUString const& rCurrentVariant : 
pTransitionEntry->mnVariants)
+                if (!nFirstItem)
+                    nFirstItem = nItem;
+                if( !aIt->getVariantLabel().isEmpty() )
                 {
-                    mxLB_VARIANT->append_text(rCurrentVariant);
-                    if (pPreset->getVariantLabel() == rCurrentVariant)
-                        mxLB_VARIANT->set_active(mxLB_VARIANT->get_count() - 
1);
+                    mxLB_VARIANT->append_text( aIt->getVariantLabel() );
+                    if( *pFound == aIt )
+                        mxLB_VARIANT->set_active( mxLB_VARIANT->get_count()-1 
);
                 }
-                mxLB_VARIANT->set_sensitive(true);
             }
-
-            mxTransitionsIconView->select(pTransitionEntry->mnIndex);
+            nItem++;
         }
+
+        if( mxLB_VARIANT->get_count() == 0 )
+            mxLB_VARIANT->set_sensitive( false );
+        else
+            mxLB_VARIANT->set_sensitive(true);
+
+        // item has the id of the first transition from this set.
+        mxVS_TRANSITION_ICONS->SelectItem( nFirstItem );
     }
 }
 
@@ -1121,51 +1168,47 @@ IMPL_LINK_NOARG(SlideTransitionPane, 
AutoPreviewClicked, weld::Toggleable&, void
 
 IMPL_LINK_NOARG(SlideTransitionPane, LateInitCallback, Timer *, void)
 {
-    mxTransitionsIconView->freeze();
-
-    {
-        auto pTransition = std::make_unique<TransitionEntry>();
-        const OUString aId = weld::toId(pTransition.get());
-        pTransition->msIcon = u"sd/cmd/transition-none.png"_ustr;
-        pTransition->msLabel = SdResId(STR_SLIDETRANSITION_NONE);
-        pTransition->mnIndex = 0;
-        mxTransitionsIconView->append(aId, pTransition->msLabel, 
pTransition->msIcon);
-        maTranstionMap.emplace(u"None"_ustr, std::move(pTransition));
-    }
-
     const TransitionPresetList& rPresetList = 
TransitionPreset::getTransitionPresetList();
-    size_t nIndex = 1;
-    for (TransitionPresetPtr const& pPreset: rPresetList)
+
+    size_t nPresetOffset = 0;
+    for( const TransitionPresetPtr& pPreset: rPresetList )
     {
-        const OUString aLabel = pPreset->getSetLabel();
-        if (!aLabel.isEmpty())
+        const OUString sLabel( pPreset->getSetLabel() );
+        if( !sLabel.isEmpty() )
         {
-            auto aIterator = maTranstionMap.find(pPreset->getSetId());
-            if (aIterator == maTranstionMap.end())
+            if( m_aNumVariants.find( pPreset->getSetId() ) == 
m_aNumVariants.end() )
             {
-                auto pTransition = std::make_unique<TransitionEntry>();
-                const OUString aId = weld::toId(pTransition.get());
-
-                pTransition->msIcon = u"sd/cmd/transition-"_ustr + 
pPreset->getSetId() + u".png"_ustr;
-                pTransition->msLabel = aLabel;
-                pTransition->mpPreset = pPreset;
-                if (!pPreset->getVariantLabel().isEmpty())
-                    
pTransition->mnVariants.push_back(pPreset->getVariantLabel());
-                pTransition->mnIndex = nIndex;
-                nIndex++;
-
-                mxTransitionsIconView->append(aId, pTransition->msLabel, 
pTransition->msIcon);
-                maTranstionMap.emplace(pPreset->getSetId(), 
std::move(pTransition));
+                OUString sImageName("sd/cmd/transition-" + pPreset->getSetId() 
+ ".png");
+                BitmapEx aIcon( sImageName );
+                if ( aIcon.IsEmpty() ) // need a fallback
+                    sImageName = "sd/cmd/transition-none.png";
+
+                mxVS_TRANSITION_ICONS->InsertItem(
+                    nPresetOffset + 1, Image(StockImage::Yes, sImageName), 
sLabel,
+                    VALUESET_APPEND, /* show legend */ true );
+
+                m_aNumVariants[ pPreset->getSetId() ] = 1;
             }
             else
             {
-                auto& pTransition = aIterator->second;
-                pTransition->mnVariants.push_back(pPreset->getVariantLabel());
+                m_aNumVariants[ pPreset->getSetId() ]++;
             }
         }
+        nPresetOffset++;
+    }
+    mxVS_TRANSITION_ICONS->Recalculate();
+
+    SAL_INFO( "sd.transitions", "Item transition offsets in ValueSet:");
+    for( size_t i = 0; i < mxVS_TRANSITION_ICONS->GetItemCount(); ++i )
+        SAL_INFO( "sd.transitions", i << ":" << 
mxVS_TRANSITION_ICONS->GetItemId( i ) );
+
+    nPresetOffset = 0;
+    SAL_INFO( "sd.transitions", "Transition presets by offsets:");
+    for( const auto& aIter: rPresetList )
+    {
+        SAL_INFO( "sd.transitions", nPresetOffset++ << " " <<
+                  aIter->getPresetId() << ": " << aIter->getSetId() );
     }
-    mxTransitionsIconView->set_size_request(0, 0);
-    mxTransitionsIconView->thaw();
 
     updateSoundList();
     updateControls();
diff --git a/sd/source/ui/inc/SlideTransitionPane.hxx 
b/sd/source/ui/inc/SlideTransitionPane.hxx
index d7fc32a67686..8975b7a1b967 100644
--- a/sd/source/ui/inc/SlideTransitionPane.hxx
+++ b/sd/source/ui/inc/SlideTransitionPane.hxx
@@ -36,7 +36,8 @@ namespace sd::tools { class EventMultiplexerEvent; }
 
 namespace sd
 {
-class TransitionPreset;
+
+class TransitionPane;
 class ViewShellBase;
 
 namespace impl
@@ -44,15 +45,6 @@ namespace impl
     struct TransitionEffect;
 }
 
-struct TransitionEntry
-{
-    OUString msIcon;
-    OUString msLabel;
-    size_t mnIndex = 0;
-    std::vector<OUString> mnVariants;
-    std::shared_ptr<TransitionPreset> mpPreset;
-};
-
 class SlideTransitionPane final : public PanelLayout
                           , public sfx2::sidebar::ILayoutableWindow
 {
@@ -71,7 +63,7 @@ public:
 private:
     void updateControls();
     void updateControlState();
-    void updateVariants(std::shared_ptr<TransitionPreset> const& pPreset);
+    void updateVariants(size_t nPresetOffset);
 
     void updateSoundList();
     void openSoundFileDialog();
@@ -92,7 +84,7 @@ private:
     DECL_LINK( PlayButtonClicked, weld::Button&, void );
     DECL_LINK( AutoPreviewClicked, weld::Toggleable&, void );
 
-    DECL_LINK( TransitionSelected, weld::IconView&, bool );
+    DECL_LINK( TransitionSelected, ValueSet*, void );
     DECL_LINK( AdvanceSlideRadioButtonToggled, weld::Toggleable&, void );
     DECL_LINK( RepeatAfterRadioButtonToggled, weld::Toggleable&, void );
     DECL_LINK( AdvanceTimeModified, weld::MetricSpinButton&, void );
@@ -108,8 +100,8 @@ private:
     ViewShellBase &   mrBase;
     SdDrawDocument *  mpDrawDoc;
 
-    std::unique_ptr<weld::IconView> mxTransitionsIconView;
-    std::unique_ptr<weld::ScrolledWindow> mxTransitionsScrollWindow;
+    std::unique_ptr<TransitionPane> mxVS_TRANSITION_ICONS;
+    std::unique_ptr<weld::CustomWeld> mxVS_TRANSITION_ICONSWin;
     std::unique_ptr<weld::Frame> mxRepeatAutoFrame;
     std::unique_ptr<weld::ComboBox> mxLB_VARIANT;
     std::unique_ptr<weld::MetricSpinButton> mxCBX_duration;
@@ -129,8 +121,6 @@ private:
     css::uno::Reference< css::drawing::XDrawView >             mxView;
     rtl::Reference< SdXImpressDocument >                  mxModel;
 
-    std::unordered_map<OUString, std::unique_ptr<TransitionEntry>> 
maTranstionMap;
-
     bool         mbHasSelection;
     bool         mbUpdatingControls;
     bool         mbIsMainViewChangePending;
@@ -138,6 +128,9 @@ private:
     std::vector<OUString>  maSoundList;
     mutable OUString maCurrentSoundFile;
 
+    // How many variants each transition set has
+    std::map< OUString, int > m_aNumVariants;
+
     Timer maLateInitTimer;
 };
 
diff --git a/sd/uiconfig/simpress/ui/slidetransitionspanel.ui 
b/sd/uiconfig/simpress/ui/slidetransitionspanel.ui
index bc214c726714..0299141be985 100644
--- a/sd/uiconfig/simpress/ui/slidetransitionspanel.ui
+++ b/sd/uiconfig/simpress/ui/slidetransitionspanel.ui
@@ -17,16 +17,6 @@
     <property name="can-focus">False</property>
     <property name="icon-name">sd/res/playblue_16.png</property>
   </object>
-  <object class="GtkTreeStore" id="liststore1">
-    <columns>
-      <!-- column-name expander -->
-      <column type="GdkPixbuf"/>
-      <!-- column-name text -->
-      <column type="gchararray"/>
-      <!-- column-name id -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
   <object class="GtkBox" id="SlideTransitionsPanel">
     <property name="visible">True</property>
     <property name="can-focus">False</property>
@@ -41,32 +31,44 @@
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
         <child>
-          <object class="GtkScrolledWindow" 
id="transitions_icons_scrolled_window">
+          <object class="GtkBox" id="box4">
             <property name="visible">True</property>
-            <property name="can-focus">True</property>
-            <property name="hexpand">True</property>
+            <property name="can-focus">False</property>
             <property name="vexpand">True</property>
-            <property name="hscrollbar-policy">never</property>
-            <property name="shadow-type">in</property>
             <child>
-              <object class="GtkIconView" id="transitions_icons">
+              <object class="GtkScrolledWindow" id="transitions_iconswin">
                 <property name="visible">True</property>
                 <property name="can-focus">True</property>
-                <property name="margin">6</property>
                 <property name="hexpand">True</property>
                 <property name="vexpand">True</property>
-                <property name="model">liststore1</property>
-                <property name="pixbuf-column">0</property>
-                <property name="text-column">1</property>
-                <property name="item-width">55</property>
-                <property name="tooltip-column">1</property>
-                <property name="activate-on-single-click">True</property>
-                <child internal-child="accessible">
-                  <object class="AtkObject" id="transitions_icons-atkobject">
-                    <property name="AtkObject::accessible-description" 
translatable="yes" 
context="slidetransitionspanel|extended_tip|transitions_icons">Select the slide 
transition you want to use for the selected slides.</property>
+                <property name="hscrollbar-policy">never</property>
+                <property name="shadow-type">in</property>
+                <child>
+                  <object class="GtkViewport">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <child>
+                      <object class="GtkDrawingArea" id="transitions_icons">
+                        <property name="visible">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="events">GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | 
GDK_STRUCTURE_MASK</property>
+                        <property name="hexpand">True</property>
+                        <property name="vexpand">True</property>
+                        <child internal-child="accessible">
+                          <object class="AtkObject" 
id="transitions_icons-atkobject">
+                            <property name="AtkObject::accessible-description" 
translatable="yes" 
context="slidetransitionspanel|extended_tip|transitions_icons">Select the slide 
transition you want to use for the selected slides.</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
             </child>
           </object>
           <packing>
diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 5a056751b105..5e2416791b2c 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -700,6 +700,24 @@ void ValueSet::ImplDraw(vcl::RenderContext& rRenderContext)
     ImplDrawSelect(rRenderContext);
 }
 
+/**
+* An inelegant method; sets the item width & height such that
+* all of the included items and their labels fit; if we can
+* calculate that.
+*/
+void ValueSet::RecalculateItemSizes()
+{
+  Size aLargestItem = GetLargestItemSize();
+
+  if ( mnUserItemWidth != aLargestItem.Width() ||
+       mnUserItemHeight != aLargestItem.Height() )
+  {
+      mnUserItemWidth = aLargestItem.Width();
+      mnUserItemHeight = aLargestItem.Height();
+      QueueReformat();
+  }
+}
+
 void ValueSet::SetFirstLine(sal_uInt16 nNewFirstLine)
 {
     if (nNewFirstLine != mnFirstLine)

Reply via email to