[Libreoffice-commits] .: 2 commits - cui/source solenv/gbuild

Michael Meeks michael at kemper.freedesktop.org
Mon Sep 12 03:46:42 PDT 2011


 cui/source/inc/cuitabarea.hxx    |   20 +++++++-
 cui/source/tabpages/tpcolor.cxx  |   89 +++++++++++++++++++++++++++++----------
 solenv/gbuild/platform/unxgcc.mk |    1 
 3 files changed, 86 insertions(+), 24 deletions(-)

New commits:
commit 473ba86d1307bccc2d5e22dcc360df75011bc2bc
Author: Jan Hubicka <jh at suse.cz>
Date:   Mon Sep 12 12:46:20 2011 +0200

    fix link time optimisation flags to use linker plugin & optimisation

diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 5c71bd4..362b378 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -126,6 +126,7 @@ endif
 
 ifeq ($(ENABLE_LTO),TRUE)
 gb_Library_LTOFLAGS := -flto
+gb_LinkTarget_LDFLAGS += -fuse-linker-plugin $(gb_COMPILERDEFAULTOPTFLAGS)
 endif
 
 ifneq ($(strip $(SYSBASE)),)
commit 731a562f54b9e39ca2b49160f4f463eb1f6b5dd7
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Mon Sep 12 11:26:35 2011 +0200

    start of embedding check-button & cui code cleanup

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index cafdc48..a7ce897 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -641,9 +641,25 @@ public:
     virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
 };
 
+// Load save embed functionality
+class SvxLoadSaveEmbed {
+    Window             *pTopDlg;
+    CheckBox            aBoxEmbed;
+    DECL_LINK( EmbedToggleHdl_Impl, void * );
+public: //  FIXME: privatise these members ...
+    ImageButton         aBtnLoad;
+    ImageButton         aBtnSave;
+    SvxLoadSaveEmbed( Window *pParent, const ResId &aLoad,
+                      const ResId &aSave, const ResId &aEmbed );
+    XPropertyList *GetList();
+    void HideLoadSaveEmbed();
+    bool GetEmbed();
+    void SetEmbed( bool bEmbed );
+};
+
 /************************************************************************/
 
-class SvxColorTabPage : public SfxTabPage
+class SvxColorTabPage : public SfxTabPage, public SvxLoadSaveEmbed
 {
     using TabPage::ActivatePage;
     using TabPage::DeactivatePage;
@@ -676,8 +692,6 @@ private:
     PushButton          aBtnModify;
     PushButton          aBtnWorkOn;
     PushButton          aBtnDelete;
-    ImageButton         aBtnLoad;
-    ImageButton         aBtnSave;
 
     const SfxItemSet&   rOutAttrs;
 
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 0a49fa9..89bc296 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -55,12 +55,6 @@
 
 #define DLGWIN GetParentDialog( this )
 
-/*************************************************************************
-|*
-|*  Dialog zum Aendern und Definieren der Farben
-|*
-\************************************************************************/
-
 static Window* GetParentDialog( Window* pWindow )
 {
     while( pWindow )
@@ -74,6 +68,66 @@ static Window* GetParentDialog( Window* pWindow )
     return pWindow;
 }
 
+// Load save embed functionality
+SvxLoadSaveEmbed::SvxLoadSaveEmbed( Window *pParent, const ResId &rLoad,
+                                    const ResId &rSave, const ResId &rEmbed )
+    : pTopDlg( GetParentDialog( pParent ) )
+    , aBoxEmbed( pParent, rEmbed )
+    , aBtnLoad( pParent, rLoad )
+    , aBtnSave( pParent, rSave )
+{
+    aBoxEmbed.SetToggleHdl( LINK( this, SvxLoadSaveEmbed, EmbedToggleHdl_Impl ) );
+    SetEmbed( GetEmbed() );
+}
+
+XPropertyList *SvxLoadSaveEmbed::GetList()
+{
+    SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( pTopDlg );
+    SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( pTopDlg );
+
+    const XPropertyList *pList = NULL;
+    if( pArea )
+        pList = pArea->GetNewColorTable();
+    if( pLine )
+        pList = pLine->GetNewColorTable();
+
+    if( !pList ) {
+        if( pArea )
+            pList = pArea->GetColorTable();
+        if( pLine )
+            pList = pLine->GetColorTable();
+    }
+
+    return const_cast<XPropertyList *>(pList);
+}
+
+void SvxLoadSaveEmbed::SetEmbed( bool bEmbed )
+{
+    XPropertyList *pList = GetList();
+    if( pList)
+        pList->SetEmbedInDocument( bEmbed );
+    aBoxEmbed.Check( bEmbed );
+}
+
+bool SvxLoadSaveEmbed::GetEmbed()
+{
+    XPropertyList *pList = GetList();
+    return pList ? pList->IsEmbedInDocument() : 0;
+}
+
+IMPL_LINK( SvxLoadSaveEmbed, EmbedToggleHdl_Impl, void *, EMPTYARG )
+{
+    SetEmbed( aBoxEmbed.IsChecked() );
+    return 0;
+}
+
+void SvxLoadSaveEmbed::HideLoadSaveEmbed()
+{
+    aBtnLoad.Hide();
+    aBtnSave.Hide();
+    aBoxEmbed.Hide();
+}
+
 SvxColorTabPage::SvxColorTabPage
 (
     Window* pParent,
@@ -81,6 +135,8 @@ SvxColorTabPage::SvxColorTabPage
 ) :
 
     SfxTabPage          ( pParent, CUI_RES( RID_SVXPAGE_COLOR ), rInAttrs ),
+    SvxLoadSaveEmbed    ( this, CUI_RES( BTN_LOAD ), CUI_RES( BTN_SAVE ),
+                          CUI_RES( BTN_EMBED ) ),
 
     aFlProp             ( this, CUI_RES( FL_PROP ) ),
     aFtName             ( this, CUI_RES( FT_NAME ) ),
@@ -107,8 +163,6 @@ SvxColorTabPage::SvxColorTabPage
     aBtnModify          ( this, CUI_RES( BTN_MODIFY ) ),
     aBtnWorkOn          ( this, CUI_RES( BTN_WORK_ON ) ),
     aBtnDelete          ( this, CUI_RES( BTN_DELETE ) ),
-    aBtnLoad            ( this, CUI_RES( BTN_LOAD ) ),
-    aBtnSave            ( this, CUI_RES( BTN_SAVE ) ),
 
     rOutAttrs           ( rInAttrs ),
     pColorTab( NULL ),
@@ -250,15 +304,7 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
         }
     }
     else
-    {
-        // Buttons werden gehided, weil Paletten z.Z. nur
-        // ueber den AreaDlg funktionieren!!!
-        // ActivatePage() muss von anderen Dialogen explizit
-        // gerufen werden, da ActivatePage() nicht gerufen wird,
-        // wenn Seite als Erste im Dialog angezeigt wird
-        aBtnLoad.Hide();
-        aBtnSave.Hide();
-    }
+        HideLoadSaveEmbed();
 }
 
 // -----------------------------------------------------------------------
@@ -761,19 +807,19 @@ IMPL_LINK( SvxColorTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
             if( pColTab->Load() )
             {
                 // Pruefen, ob Tabelle geloescht werden darf:
-                const XColorList *pTempTable = 0;
+                const XColorList *pTempList = 0;
                 SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( DLGWIN );
                 SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( DLGWIN );
                 if( pArea )
                 {
-                    pTempTable = pArea->GetColorTable();
+                    pTempList = pArea->GetColorTable();
                 }
                 else if( pLine )
                 {
-                        pTempTable = pLine->GetColorTable();
+                        pTempList = pLine->GetColorTable();
                 }
 
-                if( pColorTab != pTempTable )
+                if( pColorTab != pTempList )
                 {
                     if( bDeleteColorTable )
                         delete pColorTab;
@@ -825,6 +871,7 @@ IMPL_LINK( SvxColorTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
 
                 ChangeColorHdl_Impl( this );
                 SelectColorLBHdl_Impl( this );
+                SetEmbed( true );
             }
             else
             {


More information about the Libreoffice-commits mailing list