[Libreoffice-commits] core.git: 2 commits - cui/source vcl/source

Caolán McNamara caolanm at redhat.com
Sat May 4 12:53:37 PDT 2013


 cui/source/inc/macroass.hxx      |    1 +
 cui/source/tabpages/macroass.cxx |   31 +++++++++++++++++++++++--------
 vcl/source/window/builder.cxx    |    3 +++
 3 files changed, 27 insertions(+), 8 deletions(-)

New commits:
commit cf3d6757a9052565fa8f5b3301e2fe6874af2f66
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 3 17:17:10 2013 +0100

    fix macro assign dialog
    
    Which was empty of contents e.g. from autotext->macro...
    
    because of 5d84af7e83404f22d3c9cd0b0bb88fb84d0550e7
    "fdo#57553: Picture dialog Macro tab page: lazily init"
    
    which was because of bd2c14ec78a7549d4a19738154cdd5ea890f61c4
    "we have to have all tabpages in all modes now"
    
    which was because we need to create all tabpages in order to determine their
    size for layout.
    
        Change-Id: I01fe03abf3e4582e87927729286a21d0bac7037c
    
    Change-Id: Ic662f6a927225b56820ccebf135b82ab1631974d

diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx
index 133d88f..72ccce6 100644
--- a/cui/source/inc/macroass.hxx
+++ b/cui/source/inc/macroass.hxx
@@ -69,6 +69,7 @@ public:
     virtual void                PageCreated (SfxAllItemSet aSet);
     using TabPage::ActivatePage; // FIXME WTF is this nonsense?
     virtual void                ActivatePage( const SfxItemSet& );
+    void                        LaunchFillGroup();
 
     // --------- inherit from the base -------------
     virtual sal_Bool                FillItemSet( SfxItemSet& rSet );
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 6c127c4..92db6dd 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -213,6 +213,16 @@ sal_Bool _SfxMacroTabPage::FillItemSet( SfxItemSet& rSet )
     return sal_False;
 }
 
+void _SfxMacroTabPage::LaunchFillGroup()
+{
+    if (!mpImpl->maFillGroupTimer.GetTimeoutHdl().IsSet())
+    {
+        mpImpl->maFillGroupTimer.SetTimeoutHdl( STATIC_LINK( this, _SfxMacroTabPage, TimeOut_Impl ) );
+        mpImpl->maFillGroupTimer.SetTimeout( 0 );
+        mpImpl->maFillGroupTimer.Start();
+    }
+}
+
 void _SfxMacroTabPage::ActivatePage( const SfxItemSet& )
 {
     // fdo#57553 lazily init script providers, because it is annoying if done
@@ -220,13 +230,9 @@ void _SfxMacroTabPage::ActivatePage( const SfxItemSet& )
     if (!mpImpl->m_bDummyActivated)
     {
         mpImpl->m_bDummyActivated = true;
+        return;
     }
-    else if (!mpImpl->maFillGroupTimer.GetTimeoutHdl().IsSet())
-    {
-        mpImpl->maFillGroupTimer.SetTimeoutHdl( STATIC_LINK( this, _SfxMacroTabPage, TimeOut_Impl ) );
-        mpImpl->maFillGroupTimer.SetTimeout( 0 );
-        mpImpl->maFillGroupTimer.Start();
-    }
+    LaunchFillGroup();
 }
 
 void _SfxMacroTabPage::PageCreated (SfxAllItemSet aSet)
@@ -477,17 +483,26 @@ SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId, const Re
     ScriptChanged();
 }
 
+namespace
+{
+    SfxMacroTabPage* CreateSfxMacroTabPage( Window* pParent, const SfxItemSet& rAttrSet )
+    {
+        return new SfxMacroTabPage( pParent, CUI_RES( RID_SVXPAGE_EVENTASSIGN ), NULL, rAttrSet );
+    }
+}
+
 SfxTabPage* SfxMacroTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
 {
-    return new SfxMacroTabPage( pParent, CUI_RES( RID_SVXPAGE_EVENTASSIGN ), NULL, rAttrSet );
+    return CreateSfxMacroTabPage(pParent, rAttrSet);
 }
 
 SfxMacroAssignDlg::SfxMacroAssignDlg( Window* pParent, const Reference< XFrame >& rxDocumentFrame, const SfxItemSet& rSet )
     : SfxNoLayoutSingleTabDialog( pParent, rSet, 0 )
 {
-    SfxTabPage* pPage = SfxMacroTabPage::Create( this, rSet );
+    SfxMacroTabPage* pPage = CreateSfxMacroTabPage(this, rSet);
     pPage->SetFrame( rxDocumentFrame );
     SetTabPage( pPage );
+    pPage->LaunchFillGroup();
 }
 
 SfxMacroAssignDlg::~SfxMacroAssignDlg()
commit 742e67453fba6ea540cc6f90ee52414b16543694
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat May 4 20:12:30 2013 +0100

    extract correct widget id for responses
    
    Change-Id: I5ce14e346b8ee609fdad4deae9929a90cbadd84e

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index cc3919e..c3e0a7f 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2495,6 +2495,9 @@ void VclBuilder::handleActionWidget(xmlreader::XmlReader &reader)
 
     reader.nextItem(xmlreader::XmlReader::TEXT_RAW, &name, &nsId);
     OString sID = OString(name.begin, name.length);
+    sal_Int32 nDelim = sID.indexOf(':');
+    if (nDelim != -1)
+        sID = sID.copy(0, nDelim);
     set_response(sID, sResponse.toInt32());
 }
 


More information about the Libreoffice-commits mailing list