[Libreoffice-commits] core.git: include/svx reportdesign/source svx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 23 10:48:10 UTC 2018
include/svx/strings.hrc | 1
include/svx/svdlayer.hxx | 7 ------
reportdesign/source/core/api/ReportDefinition.cxx | 2 -
svx/source/svdraw/svdlayer.cxx | 24 ----------------------
4 files changed, 1 insertion(+), 33 deletions(-)
New commits:
commit 12a99f16edb791245a1b56bc9e879f2dd3f1f656
Author: Regina Henschel <rb.henschel at t-online.de>
AuthorDate: Sun Oct 21 18:24:12 2018 +0200
Commit: Regina Henschel <rb.henschel at t-online.de>
CommitDate: Tue Oct 23 12:47:43 2018 +0200
Special methods NewStandardLayer and SetStandardLayer not needed
The method SetStandardLayer() is only used once, in method
SdrLayerAdmin::NewStandardLayer(). This method is only used once, in
OReportDefinition::init(). The difference between a layer 'Standard'
and other layers is only in mbUserDefinedLayer. But this difference is
no where evaluated. Therefore an ordinary layer is sufficient. The
layer name is neither stored nor used in the UI, thus translation is
not needed. A layer name must be set, but in this case it is not
used in code, thus handle it same as for layer 'back'.
Change-Id: Ifd4400d432d3b4702e950d3a717ed13d4075c279
Reviewed-on: https://gerrit.libreoffice.org/62144
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel at t-online.de>
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index 18fd984a1bd8..e0b57303719e 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -258,7 +258,6 @@
#define STR_UndoObjName NC_("STR_UndoObjName", "Change object name of %1 to")
#define STR_UndoObjTitle NC_("STR_UndoObjTitle", "Change object title of %1")
#define STR_UndoObjDescription NC_("STR_UndoObjDescription", "Change object description of %1")
-#define STR_StandardLayerName NC_("STR_StandardLayerName", "Standard")
#define STR_ItemValON NC_("STR_ItemValON", "on")
#define STR_ItemValOFF NC_("STR_ItemValOFF", "off")
#define STR_ItemValYES NC_("STR_ItemValYES", "yes")
diff --git a/include/svx/svdlayer.hxx b/include/svx/svdlayer.hxx
index e8433a660cf2..9c7d9ae53432 100644
--- a/include/svx/svdlayer.hxx
+++ b/include/svx/svdlayer.hxx
@@ -95,10 +95,6 @@ public:
SdrLayerID GetID() const { return nID; }
void SetModel(SdrModel* pNewModel) { pModel=pNewModel; }
- // A SdrLayer should be considered the standard Layer. It shall then set the
- // appropriate country-specific name. SetName() sets the "StandardLayer" flag
- // and if necessary returns "Userdefined".
- void SetStandardLayer();
};
#define SDRLAYER_MAXCOUNT 255
@@ -139,9 +135,6 @@ public:
// New layer is created and inserted
SdrLayer* NewLayer(const OUString& rName, sal_uInt16 nPos=0xFFFF);
- // New layer, name is retrieved from the resource
- void NewStandardLayer(sal_uInt16 nPos);
-
// Iterate over all layers
sal_uInt16 GetLayerCount() const { return sal_uInt16(maLayers.size()); }
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index de9df0d5a02d..7c0c278c167b 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -590,7 +590,7 @@ void OReportDefinition::init()
m_pImpl->m_pReportModel->GetItemPool().FreezeIdRanges();
m_pImpl->m_pReportModel->SetScaleUnit( MapUnit::Map100thMM );
SdrLayerAdmin& rAdmin = m_pImpl->m_pReportModel->GetLayerAdmin();
- rAdmin.NewStandardLayer(sal_uInt8(RPT_LAYER_FRONT));
+ rAdmin.NewLayer("front", sal_uInt8(RPT_LAYER_FRONT));
rAdmin.NewLayer("back", sal_uInt8(RPT_LAYER_BACK));
rAdmin.NewLayer("HiddenLayer", sal_uInt8(RPT_LAYER_HIDDEN));
diff --git a/svx/source/svdraw/svdlayer.cxx b/svx/source/svdraw/svdlayer.cxx
index 8c9c15852a7d..ab149bfcfa4b 100644
--- a/svx/source/svdraw/svdlayer.cxx
+++ b/svx/source/svdraw/svdlayer.cxx
@@ -76,17 +76,6 @@ SdrLayer::SdrLayer(SdrLayerID nNewID, const OUString& rNewName) :
mbLockedODF = false;
}
-void SdrLayer::SetStandardLayer()
-{
- mbUserDefinedLayer=false;
- maName = SvxResId(STR_StandardLayerName);
- if (pModel!=nullptr) {
- SdrHint aHint(SdrHintKind::LayerChange);
- pModel->Broadcast(aHint);
- pModel->SetChanged();
- }
-}
-
void SdrLayer::SetName(const OUString& rNewName)
{
if (rNewName == maName)
@@ -201,19 +190,6 @@ SdrLayer* SdrLayerAdmin::NewLayer(const OUString& rName, sal_uInt16 nPos)
return pLay;
}
-void SdrLayerAdmin::NewStandardLayer(sal_uInt16 nPos)
-{
- SdrLayerID nID=GetUniqueLayerID();
- SdrLayer* pLay=new SdrLayer(nID,OUString());
- pLay->SetStandardLayer();
- pLay->SetModel(pModel);
- if(nPos==0xFFFF)
- maLayers.push_back(std::unique_ptr<SdrLayer>(pLay));
- else
- maLayers.insert(maLayers.begin() + nPos, std::unique_ptr<SdrLayer>(pLay));
- Broadcast();
-}
-
sal_uInt16 SdrLayerAdmin::GetLayerPos(SdrLayer* pLayer) const
{
sal_uInt16 nRet=SDRLAYERPOS_NOTFOUND;
More information about the Libreoffice-commits
mailing list