summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2018-02-17 15:49:27 +0100
committerAndras Timar <andras.timar@collabora.com>2018-02-19 09:22:35 +0100
commitf26899be899f1a39ea1e6b5ad8b46bad9cf1216f (patch)
tree345407df73c3eb74fbd755209b9617aba24b2ec7 /svx
parent04040bd9e4b8cf52dc75b7d4510c6fc1d104896a (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. Reviewed-on: https://gerrit.libreoffice.org/49889 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 1da3a3cb74a415a76fa547ef0c8f61780e260e7f) Change-Id: Ie22233d33a25e605de46120bfc2195038dffd63c Reviewed-on: https://gerrit.libreoffice.org/49909 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'svx')
-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 1941cd4f3ef8..43c3ea287ac5 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -375,6 +375,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 05fa868d46ea..8444e7d09861 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -107,6 +107,7 @@ struct SdrModelImpl
SdrUndoFactory* mpUndoFactory;
bool mbAnchoredTextOverflowLegacy; // tdf#99729 compatibility flag
+ bool mbHoriAlignIgnoreTrailingWhitespace; // tdf#115639 compatibility flag
};
@@ -117,6 +118,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();
@@ -1905,6 +1907,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();
@@ -1954,6 +1967,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>
@@ -1966,6 +1986,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());