summaryrefslogtreecommitdiff
path: root/sw
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 /sw
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 'sw')
-rw-r--r--sw/source/uibase/app/docshini.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index 92b239467b04..7d8bf172e332 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -88,6 +88,7 @@
#include <swerror.h>
#include <globals.hrc>
#include <unochart.hxx>
+#include <drawdoc.hxx>
#include <svx/CommonStyleManager.hxx>
@@ -490,6 +491,15 @@ void SwDocShell::ReactivateModel()
bool SwDocShell::Load( SfxMedium& rMedium )
{
bool bRet = false;
+
+ // 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 (m_pDoc && m_pDoc->getIDocumentDrawModelAccess().GetDrawModel())
+ m_pDoc->getIDocumentDrawModelAccess().GetDrawModel()->SetAnchoredTextOverflowLegacy(true);
+ }
+
if( SfxObjectShell::Load( rMedium ))
{
SAL_INFO( "sw.ui", "after SfxInPlaceObject::Load" );