summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/IDocumentSettingAccess.hxx2
-rw-r--r--sw/inc/doc.hxx1
-rw-r--r--sw/source/core/doc/doc.cxx5
-rw-r--r--sw/source/core/doc/docnew.cxx1
-rw-r--r--sw/source/core/text/txtfly.cxx10
-rw-r--r--sw/source/filter/ww8/ww8par.cxx1
-rw-r--r--sw/source/ui/uno/SwXDocumentSettings.cxx14
7 files changed, 32 insertions, 2 deletions
diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index 8214f1abf282..6e7160944139 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -78,6 +78,8 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd
CLIPPED_PICTURES,
BACKGROUND_PARA_OVER_DRAWINGS,
TAB_OVER_MARGIN,
+ // MS Word still wraps text around objects with less space than LO would.
+ SURROUND_TEXT_WRAP_SMALL,
// COMPATIBILITY FLAGS END
BROWSE_MODE,
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index ed168699ce83..14dd33f7c23a 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -580,6 +580,7 @@ private:
bool mbClippedPictures;
bool mbBackgroundParaOverDrawings;
bool mbTabOverMargin;
+ bool mbSurroundTextWrapSmall;
bool mbLastBrowseMode : 1;
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index b71288c1a1ea..965a28ce03fb 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -195,6 +195,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
case CLIPPED_PICTURES: return mbClippedPictures;
case BACKGROUND_PARA_OVER_DRAWINGS: return mbBackgroundParaOverDrawings;
case TAB_OVER_MARGIN: return mbTabOverMargin;
+ case SURROUND_TEXT_WRAP_SMALL: return mbSurroundTextWrapSmall;
case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the ViewShell has to be asked!
case HTML_MODE: return mbHTMLMode;
@@ -354,6 +355,10 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
mbTabOverMargin = value;
break;
+ case SURROUND_TEXT_WRAP_SMALL:
+ mbSurroundTextWrapSmall = value;
+ break;
+
// COMPATIBILITY FLAGS END
case BROWSE_MODE: //can be used temporary (load/save) when no ViewShell is avaiable
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 9eb598321bfe..afe6b9cea75f 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -318,6 +318,7 @@ SwDoc::SwDoc()
mbClippedPictures(false),
mbBackgroundParaOverDrawings(false),
mbTabOverMargin(false),
+ mbSurroundTextWrapSmall(false),
mbLastBrowseMode( false ),
n32DummyCompatabilityOptions1(0),
n32DummyCompatabilityOptions2(0),
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 2a1aadaf0381..f65cb6673ff9 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -1342,6 +1342,9 @@ SwRect SwTxtFly::AnchoredObjToRect( const SwAnchoredObject* pAnchoredObj,
// Wrap only on sides with at least 2cm space for the text
#define TEXT_MIN 1134
+// MS Word wraps on sides with even less space (value guessed).
+#define TEXT_MIN_SMALL 300
+
// Wrap on both sides up to a frame width of 1.5cm
#define FRAME_MAX 850
@@ -1398,9 +1401,12 @@ SwSurround SwTxtFly::_GetSurroundForTextWrap( const SwAnchoredObject* pAnchoredO
else
nRight = 0;
}
- if( nLeft < TEXT_MIN )
+ const int textMin = GetMaster()->GetNode()
+ ->getIDocumentSettingAccess()->get(IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL )
+ ? TEXT_MIN_SMALL : TEXT_MIN;
+ if( nLeft < textMin )
nLeft = 0;
- if( nRight < TEXT_MIN )
+ if( nRight < textMin )
nRight = 0;
if( nLeft )
eSurroundForTextWrap = nRight ? SURROUND_PARALLEL : SURROUND_LEFT;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 2ff0fa72f79c..6b131acba3ee 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1557,6 +1557,7 @@ void SwWW8ImplReader::ImportDop()
rDoc.set(IDocumentSettingAccess::UNBREAKABLE_NUMBERINGS, true);
rDoc.set(IDocumentSettingAccess::CLIPPED_PICTURES, true);
rDoc.set(IDocumentSettingAccess::TAB_OVER_MARGIN, true);
+ rDoc.set(IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL, true);
//
// COMPATIBILITY FLAGS END
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index 828b6037e763..6b1c627739ee 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -124,6 +124,7 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_EMBED_FONTS,
HANDLE_EMBED_SYSTEM_FONTS,
HANDLE_TAB_OVER_MARGIN,
+ HANDLE_SURROUND_TEXT_WRAP_SMALL
};
static MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -193,6 +194,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
{ RTL_CONSTASCII_STRINGPARAM("EmbedFonts"), HANDLE_EMBED_FONTS, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("EmbedSystemFonts"), HANDLE_EMBED_SYSTEM_FONTS, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("TabOverMargin"), HANDLE_TAB_OVER_MARGIN, CPPUTYPE_BOOLEAN, 0, 0},
+ { RTL_CONSTASCII_STRINGPARAM("SurroundTextWrapSmall"), HANDLE_SURROUND_TEXT_WRAP_SMALL, CPPUTYPE_BOOLEAN, 0, 0},
/*
* As OS said, we don't have a view when we need to set this, so I have to
* find another solution before adding them to this property set - MTG
@@ -793,6 +795,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
mpDoc->set(IDocumentSettingAccess::TAB_OVER_MARGIN, bTmp);
}
break;
+ case HANDLE_SURROUND_TEXT_WRAP_SMALL:
+ {
+ sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
+ mpDoc->set(IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL, bTmp);
+ }
+ break;
default:
throw UnknownPropertyException();
}
@@ -1206,6 +1214,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue.setValue( &bTmp, ::getBooleanCppuType() );
}
break;
+ case HANDLE_SURROUND_TEXT_WRAP_SMALL:
+ {
+ sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL );
+ rValue.setValue( &bTmp, ::getBooleanCppuType() );
+ }
+ break;
default:
throw UnknownPropertyException();
}