summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2018-02-17 06:35:29 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2018-02-17 07:50:00 +0100
commit1da3a3cb74a415a76fa547ef0c8f61780e260e7f (patch)
tree0367d452050d136d6612ba708038fb9d4584987b /svx/source/svdraw
parent71545d500e4b88e960a73d499328504ce99397a8 (diff)
tdf#115639: Align right/center with trailing spaces the same as MS PowerPoint
* Add HoriAlignIgnoreTrailingWhitespace compatibility option. ** For MSO file formats it is set to true ** For ODP format it's set to false by default ** The flag is saved to ODP format as user data if the document comes from an MSO format. Change-Id: Ie22233d33a25e605de46120bfc2195038dffd63c Reviewed-on: https://gerrit.libreoffice.org/49889 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdetc.cxx1
-rw-r--r--svx/source/svdraw/svdmodel.cxx22
2 files changed, 23 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index 3c6924affdc4..5b1b2695dce6 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -343,6 +343,7 @@ SdrOutliner* SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel& rModel)
pOutl->SetAsianCompressionMode(rModel.GetCharCompressType());
pOutl->SetKernAsianPunctuation(rModel.IsKernAsianPunctuation());
pOutl->SetAddExtLeading(rModel.IsAddExtLeading());
+ pOutl->SetHoriAlignIgnoreTrailingWhitespace(rModel.IsHoriAlignIgnoreTrailingWhitespace());
return pOutl;
}
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 03330c13720c..2fab5db4323f 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -108,6 +108,7 @@ struct SdrModelImpl
SdrUndoFactory* mpUndoFactory;
bool mbAnchoredTextOverflowLegacy; // tdf#99729 compatibility flag
+ bool mbHoriAlignIgnoreTrailingWhitespace; // tdf#115639 compatibility flag
};
@@ -118,6 +119,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
mpImpl->mpUndoManager=nullptr;
mpImpl->mpUndoFactory=nullptr;
mpImpl->mbAnchoredTextOverflowLegacy = false;
+ mpImpl->mbHoriAlignIgnoreTrailingWhitespace = false;
mbInDestruction = false;
aObjUnit=SdrEngineDefaults::GetMapFraction();
eObjUnit=SdrEngineDefaults::GetMapUnit();
@@ -1833,6 +1835,17 @@ bool SdrModel::IsAnchoredTextOverflowLegacy() const
return mpImpl->mbAnchoredTextOverflowLegacy;
}
+void SdrModel::SetHoriAlignIgnoreTrailingWhitespace(bool bEnabled)
+{
+ mpImpl->mbHoriAlignIgnoreTrailingWhitespace = bEnabled;
+ pDrawOutliner->SetHoriAlignIgnoreTrailingWhitespace(bEnabled);
+}
+
+bool SdrModel::IsHoriAlignIgnoreTrailingWhitespace() const
+{
+ return mpImpl->mbHoriAlignIgnoreTrailingWhitespace;
+}
+
void SdrModel::ReformatAllTextObjects()
{
ImpReformatAllTextObjects();
@@ -1882,6 +1895,13 @@ void SdrModel::ReadUserDataSequenceValue(const css::beans::PropertyValue* pValue
mpImpl->mbAnchoredTextOverflowLegacy = bBool;
}
}
+ if (pValue->Name == "HoriAlignIgnoreTrailingWhitespace")
+ {
+ if (pValue->Value >>= bBool)
+ {
+ SetHoriAlignIgnoreTrailingWhitespace(bBool);
+ }
+ }
}
template <typename T>
@@ -1894,6 +1914,8 @@ void SdrModel::WriteUserDataSequence(css::uno::Sequence < css::beans::PropertyVa
{
std::vector< std::pair< OUString, Any > > aUserData;
addPair(aUserData, "AnchoredTextOverflowLegacy", IsAnchoredTextOverflowLegacy());
+ if (IsHoriAlignIgnoreTrailingWhitespace())
+ addPair(aUserData, "HoriAlignIgnoreTrailingWhitespace", IsHoriAlignIgnoreTrailingWhitespace());
const sal_Int32 nOldLength = rValues.getLength();
rValues.realloc(nOldLength + aUserData.size());