[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - 2 commits - cui/source include/svx sc/source svx/source sw/inc sw/qa sw/source
Tor Lillqvist
tml at collabora.com
Wed Dec 20 14:52:13 UTC 2017
cui/source/tabpages/tabline.cxx | 1 +
include/svx/svdobj.hxx | 16 ++++++++++++++--
include/svx/svdpage.hxx | 21 ++++++++++++++++++---
sc/source/ui/unoobj/cellsuno.cxx | 1 +
svx/source/svdraw/svdobj.cxx | 16 ----------------
svx/source/svdraw/svdpage.cxx | 17 -----------------
sw/inc/section.hxx | 2 +-
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 1 +
sw/source/core/docnode/ndsect.cxx | 2 +-
9 files changed, 37 insertions(+), 40 deletions(-)
New commits:
commit a17bc0a113f56c1c70f64b735f14ace86c3e1bc1
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Dec 20 15:02:46 2017 +0200
Make some functions that show up in a profile inline and handle fallout
Improves the loading time for a pathological customer document
measurably: from 1min 4s to 1min 0s on my machine.
Change-Id: If525c57bde152a71f6f50c4f0683d6d9df483a1b
Reviewed-on: https://gerrit.libreoffice.org/46853
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx
index 65a2e5268074..4412b50b82aa 100644
--- a/cui/source/tabpages/tabline.cxx
+++ b/cui/source/tabpages/tabline.cxx
@@ -30,6 +30,7 @@
#include "dlgname.hxx"
#include <dialmgr.hxx>
#include <svx/svdmodel.hxx>
+#include <svx/svdobj.hxx>
#include <svx/xtable.hxx>
#include "svx/drawitem.hxx"
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 304f403cdfd4..390afe887459 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -27,6 +27,7 @@
#include <vcl/vclptr.hxx>
#include <svl/lstner.hxx>
#include <svl/poolitem.hxx>
+#include <svx/svdpage.hxx>
#include <svx/svdtypes.hxx>
#include <svx/xenum.hxx>
#include <svx/svxdllapi.h>
@@ -470,13 +471,24 @@ public:
/// SdrObjList is changed, the bObjOrdNumsDirty flag is set on the SdrPage
/// and the next GetOrdNum() call recalculates the order number of all
/// SdrObjects in the SdrObjList.
- sal_uInt32 GetOrdNum() const;
+ sal_uInt32 GetOrdNum() const
+ {
+ if (pObjList != nullptr)
+ {
+ if (pObjList->IsObjOrdNumsDirty())
+ pObjList->RecalcObjOrdNums();
+ }
+ else
+ const_cast<SdrObject*>(this)->nOrdNum = 0;
+
+ return nOrdNum;
+ }
// Warning: this method should only be used if you really know what you're doing
sal_uInt32 GetOrdNumDirect() const { return nOrdNum;}
// setting the order number should only happen from the model or from the page
- void SetOrdNum(sal_uInt32 nNum);
+ void SetOrdNum(sal_uInt32 nNum) { nOrdNum = nNum; }
// GrabBagItem for interim interop purposes
void GetGrabBagItem(css::uno::Any& rVal) const;
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 700aa0fc5216..4a08e6a7eec5 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -27,6 +27,7 @@
#include <tools/weakbase.hxx>
#include <tools/contnr.hxx>
#include <cppuhelper/weakref.hxx>
+#include <svl/lstner.hxx>
#include <svx/svdtypes.hxx>
#include <svx/sdrpageuser.hxx>
#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
@@ -34,7 +35,6 @@
#include <svx/svxdllapi.h>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
-#include <svx/svdobj.hxx>
#include <memory>
#include <vector>
@@ -45,6 +45,8 @@ namespace sdr { namespace contact { class ViewContact; }}
class SdrPage;
class SdrModel;
class SfxItemPool;
+class SfxPoolItem;
+class SdrObject;
class SdrPageView;
class SdrLayerAdmin;
class SetOfByte;
@@ -153,8 +155,21 @@ public:
/// convert attributes of the style to hard formatting
void BurnInStyleSheetAttributes();
- size_t GetObjCount() const;
- SdrObject* GetObj(size_t nNum) const;
+ size_t GetObjCount() const
+ {
+ return maList.size();
+ }
+
+ SdrObject* GetObj(size_t nNum) const
+ {
+ if (nNum >= maList.size())
+ {
+ OSL_ASSERT(nNum<maList.size());
+ return nullptr;
+ }
+ else
+ return maList[nNum];
+ }
/// linked page or linked group object
virtual bool IsReadOnly() const;
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 522d4ae0cc1d..cbb2970287c9 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -36,6 +36,7 @@
#include <svx/unomid.hxx>
#include <editeng/unoprnms.hxx>
#include <editeng/unotext.hxx>
+#include <svx/svdobj.hxx>
#include <svx/svdpage.hxx>
#include <sfx2/bindings.hxx>
#include <svl/zforlist.hxx>
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 09e0a3486fa7..daf0e77209e4 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -776,22 +776,6 @@ OUString SdrObject::GetDescription() const
return OUString();
}
-sal_uInt32 SdrObject::GetOrdNum() const
-{
- if (pObjList!=nullptr) {
- if (pObjList->IsObjOrdNumsDirty()) {
- pObjList->RecalcObjOrdNums();
- }
- } else const_cast<SdrObject*>(this)->nOrdNum=0;
- return nOrdNum;
-}
-
-
-void SdrObject::SetOrdNum(sal_uInt32 nNum)
-{
- nOrdNum = nNum;
-}
-
void SdrObject::GetGrabBagItem(css::uno::Any& rVal) const
{
if (pGrabBagItem != nullptr)
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index e6d961b3a87e..13e04f27c6bc 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -672,23 +672,6 @@ void SdrObjList::BurnInStyleSheetAttributes()
}
}
-size_t SdrObjList::GetObjCount() const
-{
- return maList.size();
-}
-
-
-SdrObject* SdrObjList::GetObj(size_t nNum) const
-{
- if (nNum >= maList.size())
- {
- OSL_ASSERT(nNum<maList.size());
- return nullptr;
- }
- else
- return maList[nNum];
-}
-
bool SdrObjList::IsReadOnly() const
{
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index a9be7f45cb75..f7190f0d77e0 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -80,6 +80,7 @@
#include <oox/drawingml/drawingmltypes.hxx>
#include <unotools/streamwrap.hxx>
#include <comphelper/propertysequence.hxx>
+#include <svx/svdobj.hxx>
#include <svx/svdpage.hxx>
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
#include <com/sun/star/awt/CharSet.hpp>
commit 9675f307fbd7961b3d00f810dad3eacc9920e07d
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Dec 20 13:28:53 2017 +0200
Make SwSection::GetSectionName() return a reference to the name
Has a small but measureable impact on the time it takes to load a
specific pathological (huge) customer document. The load time drops
from 1min 8s to 1min 4s on my machine.
Change-Id: I93b603f369528187980d644a5364fa9bcf2f4615
Reviewed-on: https://gerrit.libreoffice.org/46847
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 4fea7232048c..ad0960f68ce5 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -166,7 +166,7 @@ public:
void SetSectionData(SwSectionData const& rData);
- OUString GetSectionName() const { return m_Data.GetSectionName(); }
+ const OUString& GetSectionName() const { return m_Data.GetSectionName(); }
void SetSectionName(OUString const& rName){ m_Data.SetSectionName(rName); }
SectionType GetType() const { return m_Data.GetType(); }
void SetType(SectionType const eType) { return m_Data.SetType(eType); }
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 32e2f0260a4c..a8dc9da00c6b 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -1372,7 +1372,7 @@ OUString SwDoc::GetUniqueSectionName( const OUString* pChkStr ) const
const SwSectionNode *const pSectNd = pFormat->GetSectionNode();
if( pSectNd != nullptr )
{
- const OUString rNm = pSectNd->GetSection().GetSectionName();
+ const OUString& rNm = pSectNd->GetSection().GetSectionName();
if (rNm.startsWith( aName ))
{
// Calculate the Number and reset the Flag
More information about the Libreoffice-commits
mailing list