summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2016-06-28 19:13:22 +1000
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-28 17:27:28 +0000
commit0cb200d000fad8ba31c7400e08cd031823f27308 (patch)
treecfe441bb41ad09c86bc60d4cbe18d83982c0bf90 /sc
parentc1ab6613ae7b45f2d90aafd6c6a829a471ceca55 (diff)
tdf#99729: fix text alignment (no autofit & no full width)
If TextBox contained text that is larger than the box, and autofit was off, and autosize was off, and full width was off, then text always aligned to box's left top corner, regardless of text anchor setting. Related problem (i103454) was fixed in 2009 by Armin Le Grand, but only for full width text. This patch extends the scope of that fix to correctly process other cases. The fix introduces a new compatibility flag: AnchoredTextOverflowLegacy If it is true, then old behaviour is retained. It is always false for new documents and imported documents. When opening existing ODF documents, it's true by default, unless it is explicitly set in settings.xml. Unfortunately, I couldn't find a way to access the document model from any of SfxBaseModel::load() or SfxObjectShell::DoLoad, where it could enable setting the compatibility flag universally when loading own format. Instead, I had to do it individually in each of SfxObjectShell::Load() implementations. Unit test is included. Change-Id: Ifad79d546739daafff59fb6c7fb0dce51babc53d Reviewed-on: https://gerrit.libreoffice.org/26737 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/docsh.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 79cb8c844be0..d700e16a7d9a 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -557,6 +557,14 @@ bool ScDocShell::Load( SfxMedium& rMedium )
// -> initialize the others from options (before loading)
InitOptions(true);
+ // If this is an ODF file being loaded, then by default, use legacy processing
+ // for tdf#99729 (if required, it will be overriden in *::ReadUserDataSequence())
+ if (IsOwnStorageFormat(rMedium))
+ {
+ if (aDocument.GetDrawLayer())
+ aDocument.GetDrawLayer()->SetAnchoredTextOverflowLegacy(true);
+ }
+
GetUndoManager()->Clear();
bool bRet = SfxObjectShell::Load( rMedium );