[Libreoffice-commits] core.git: 2 commits - bin/gbuild-to-ide sc/inc sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Sep 6 06:45:31 PDT 2014


 bin/gbuild-to-ide                |    2 +-
 sc/inc/docpool.hxx               |    3 ++-
 sc/inc/patattr.hxx               |    3 +--
 sc/source/core/data/docpool.cxx  |    5 +++--
 sc/source/core/data/document.cxx |    8 ++------
 sc/source/core/data/patattr.cxx  |    4 +---
 sc/source/ui/undo/undostyl.cxx   |    2 +-
 sc/source/ui/unoobj/styleuno.cxx |    4 ++--
 sc/source/ui/view/formatsh.cxx   |    4 ++--
 9 files changed, 15 insertions(+), 20 deletions(-)

New commits:
commit 9e6221f114ba4422caa79f38ee0a20fb8a8931cd
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Sep 6 15:22:18 2014 +0200

    clang does not like gnu++11 that much, use c++11 instead
    
    Change-Id: I82c3a4da388cf436ba4f5380c5833a451e28cfd5

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index f005cf2..2e8bc30 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -258,7 +258,7 @@ class VimIntegrationGenerator(IdeIntegrationGenerator):
             command += cxxflag
         command += ' -c '
         command += file
-        return command
+        return command.replace('-std=gnu++11', '-std=c++11')
 
 class KdevelopIntegrationGenerator(IdeIntegrationGenerator):
     def encode_int(self, i):
commit 3deacd971b843a752ddf456916209f52c9aa992f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Sep 4 00:14:59 2014 +0200

    How the hell did this survive 14 years? Kill it!
    
    No need for a ugly static variable that just causes pain.
    
    Change-Id: I751f58a5dcfdeaa7bfd61f32ccbc13eaaf827632

diff --git a/sc/inc/docpool.hxx b/sc/inc/docpool.hxx
index db65148..b733486 100644
--- a/sc/inc/docpool.hxx
+++ b/sc/inc/docpool.hxx
@@ -25,6 +25,7 @@
 #include "scdllapi.h"
 
 class ScStyleSheet;
+class ScDocument;
 
 class SC_DLLPUBLIC ScDocumentPool: public SfxItemPool
 {
@@ -57,7 +58,7 @@ public:
     static void                 CheckRef( const SfxPoolItem& );
 
     void StyleDeleted( ScStyleSheet* pStyle );      // delete templates(?) in organizer
-    void CellStyleCreated( const OUString& rName );
+    void CellStyleCreated( const OUString& rName, ScDocument* pDoc );
     virtual bool GetPresentation(
                                         const SfxPoolItem&  rItem,
                                         SfxMapUnit          ePresentationMetric,
diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index 65b189a..00d0c98 100644
--- a/sc/inc/patattr.hxx
+++ b/sc/inc/patattr.hxx
@@ -51,7 +51,6 @@ class SC_DLLPUBLIC ScPatternAttr: public SfxSetItem
     OUString*       pName;
     ScStyleSheet*   pStyle;
 public:
-    static ScDocument* pDoc;
                             ScPatternAttr(SfxItemSet* pItemSet, const OUString& rStyleName);
                             ScPatternAttr(SfxItemSet* pItemSet, ScStyleSheet* pStyleSheet = NULL);
                             ScPatternAttr(SfxItemPool* pItemPool);
@@ -113,7 +112,7 @@ public:
     void                    SetStyleSheet(ScStyleSheet* pNewStyle, bool bClearDirectFormat = true);
     const ScStyleSheet*     GetStyleSheet() const  { return pStyle; }
     const OUString*         GetStyleName() const;
-    void                    UpdateStyleSheet();
+    void                    UpdateStyleSheet(ScDocument* pDoc);
     void                    StyleToName();
 
     bool                    IsVisible() const;
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 6e4a4bd..f3fa1d8 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -67,6 +67,7 @@
 #include "attrib.hxx"
 #include "patattr.hxx"
 #include "globstr.hrc"
+#include "document.hxx"
 #include "sc.hrc"
 
 #define SC_MAX_POOLREF      (SFX_ITEMS_OLD_MAXREF - 39)
@@ -662,7 +663,7 @@ void ScDocumentPool::StyleDeleted( ScStyleSheet* pStyle )
     }
 }
 
-void ScDocumentPool::CellStyleCreated( const OUString& rName )
+void ScDocumentPool::CellStyleCreated( const OUString& rName, ScDocument* pDoc )
 {
     // If a style was created, don't keep any pattern with its name string in the pool,
     // because it would compare equal to a pattern with a pointer to the new style.
@@ -679,7 +680,7 @@ void ScDocumentPool::CellStyleCreated( const OUString& rName )
         {
             const OUString* pStyleName = pPattern->GetStyleName();
             if ( pStyleName && *pStyleName == rName )
-                pPattern->UpdateStyleSheet(); // find and store style pointer
+                pPattern->UpdateStyleSheet(pDoc); // find and store style pointer
         }
     }
 }
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 406f0f1..2014153 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -5536,8 +5536,6 @@ void ScDocument::GetNextPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX,
 
 void ScDocument::UpdStlShtPtrsFrmNms()
 {
-    ScPatternAttr::pDoc = this;
-
     ScDocumentPool* pPool = xPoolHelper->GetDocPool();
 
     sal_uInt32 nCount = pPool->GetItemCount2(ATTR_PATTERN);
@@ -5546,15 +5544,13 @@ void ScDocument::UpdStlShtPtrsFrmNms()
     {
         pPattern = (ScPatternAttr*)pPool->GetItem2(ATTR_PATTERN, i);
         if (pPattern)
-            pPattern->UpdateStyleSheet();
+            pPattern->UpdateStyleSheet(this);
     }
-    ((ScPatternAttr&)pPool->GetDefaultItem(ATTR_PATTERN)).UpdateStyleSheet();
+    ((ScPatternAttr&)pPool->GetDefaultItem(ATTR_PATTERN)).UpdateStyleSheet(this);
 }
 
 void ScDocument::StylesToNames()
 {
-    ScPatternAttr::pDoc = this;
-
     ScDocumentPool* pPool = xPoolHelper->GetDocPool();
 
     sal_uInt32 nCount = pPool->GetItemCount2(ATTR_PATTERN);
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index bca6a4b..29351ec 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -63,8 +63,6 @@
 
 // STATIC DATA -----------------------------------------------------------
 
-ScDocument* ScPatternAttr::pDoc = NULL;
-
 using sc::HMMToTwips;
 using sc::TwipsToHMM;
 
@@ -1141,7 +1139,7 @@ void ScPatternAttr::SetStyleSheet( ScStyleSheet* pNewStyle, bool bClearDirectFor
     }
 }
 
-void ScPatternAttr::UpdateStyleSheet()
+void ScPatternAttr::UpdateStyleSheet(ScDocument* pDoc)
 {
     if (pName)
     {
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index f09971f..d84d55a 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -146,7 +146,7 @@ void ScUndoModifyStyle::DoChange( ScDocShell* pDocSh, const OUString& rName,
         pStyle = &pStlPool->Make( aNewName, eStyleFamily, SFXSTYLEBIT_USERDEF );
 
         if ( eStyleFamily == SFX_STYLE_FAMILY_PARA )
-            rDoc.GetPool()->CellStyleCreated( aNewName );
+            rDoc.GetPool()->CellStyleCreated( aNewName, &rDoc );
     }
 
     if ( pStyle )
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 666e145..bd88df7 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -696,7 +696,7 @@ void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno::
                 (void)pStylePool->Make( aNameStr, eFamily, SFXSTYLEBIT_USERDEF );
 
                 if ( eFamily == SFX_STYLE_FAMILY_PARA && !rDoc.IsImportingXML() )
-                    rDoc.GetPool()->CellStyleCreated( aNameStr );
+                    rDoc.GetPool()->CellStyleCreated( aNameStr, &rDoc );
 
                 pStyleObj->InitDoc( pDocShell, aNameStr );  // Objekt kann benutzt werden
 
@@ -1143,7 +1143,7 @@ void SAL_CALL ScStyleObj::setName( const OUString& aNewName )
 
             ScDocument& rDoc = pDocShell->GetDocument();
             if ( eFamily == SFX_STYLE_FAMILY_PARA && !rDoc.IsImportingXML() )
-                rDoc.GetPool()->CellStyleCreated( aString );
+                rDoc.GetPool()->CellStyleCreated( aString, &rDoc );
 
             //  Zellvorlagen = 2, Seitenvorlagen = 4
             sal_uInt16 nId = ( eFamily == SFX_STYLE_FAMILY_PARA ) ?
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index f778013..2bdb132 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -608,7 +608,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
                                 // Namen zu Style-Pointer
                                 rDoc.UpdStlShtPtrsFrmNms();
                             else
-                                rDoc.GetPool()->CellStyleCreated( aStyleName );
+                                rDoc.GetPool()->CellStyleCreated( aStyleName, &rDoc );
 
                             // Attribute uebernehmen und Style anwenden
                             pStyleSheet->GetItemSet().Put( aAttrSet );
@@ -905,7 +905,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
                                                     pNew->GetLanguage(), ATTR_LANGUAGE_FORMAT ) );
                             }
 
-                            rDoc.GetPool()->CellStyleCreated( pStyleSheet->GetName() );
+                            rDoc.GetPool()->CellStyleCreated( pStyleSheet->GetName(), &rDoc );
                         }
                         else
                         {


More information about the Libreoffice-commits mailing list