diff options
-rw-r--r-- | sw/inc/IDocumentSettingAccess.hxx | 1 | ||||
-rw-r--r-- | sw/inc/doc.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/doc/doc.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/text/txttab.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 1 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/uno/SwXDocumentSettings.cxx | 16 | ||||
-rw-r--r-- | writerfilter/source/filter/ImportFilter.cxx | 1 |
9 files changed, 39 insertions, 2 deletions
diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx index ac5770bb5ac9..3042f8aad4aa 100644 --- a/sw/inc/IDocumentSettingAccess.hxx +++ b/sw/inc/IDocumentSettingAccess.hxx @@ -86,6 +86,7 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd UNBREAKABLE_NUMBERINGS, BACKGROUND_PARA_OVER_DRAWINGS, CLIPPED_PICTURES, + TAB_OVER_MARGIN, // COMPATIBILITY FLAGS END BROWSE_MODE, diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 1f269bf2c830..caf0eb69f75b 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -592,6 +592,7 @@ private: bool mbUnbreakableNumberings; bool mbBackgroundParaOverDrawings; bool mbClippedPictures; + bool mbTabOverMargin; bool mbLastBrowseMode : 1; diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 07eaa4923009..5f9461b9f71d 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -201,6 +201,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const case UNBREAKABLE_NUMBERINGS: return mbUnbreakableNumberings; case BACKGROUND_PARA_OVER_DRAWINGS: return mbBackgroundParaOverDrawings; case CLIPPED_PICTURES: return mbClippedPictures; + case TAB_OVER_MARGIN: return mbTabOverMargin; case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the ViewShell has to be asked! case HTML_MODE: return mbHTMLMode; @@ -352,6 +353,10 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) mbClippedPictures = value; break; + case TAB_OVER_MARGIN: + mbTabOverMargin = 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 4948f241215f..5cbc4248a25d 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -363,6 +363,7 @@ SwDoc::SwDoc() mbFloattableNomargins = false; mbBackgroundParaOverDrawings = false; mbClippedPictures = false; + mbTabOverMargin = false; // // COMPATIBILITY FLAGS END diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 8841e399fb04..798f68782f81 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -494,7 +494,10 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf ) sal_Bool SwTabPortion::PostFormat( SwTxtFormatInfo &rInf ) { - const KSHORT nRight = Min( GetTabPos(), rInf.Width() ); + const bool bTabOverMargin = rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_OVER_MARGIN); + // If the tab position is larger than the right margin, it gets scaled down by default. + // However, if compat mode enabled, we allow tabs to go over the margin: the rest of the paragraph is not broken into lines. + const KSHORT nRight = bTabOverMargin ? GetTabPos() : Min(GetTabPos(), rInf.Width()); const SwLinePortion *pPor = GetPortion(); KSHORT nPorWidth = 0; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 2ab64e8a694c..56d0697139ba 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1580,6 +1580,7 @@ void SwWW8ImplReader::ImportDop() rDoc.set(IDocumentSettingAccess::TAB_OVERFLOW, true); rDoc.set(IDocumentSettingAccess::UNBREAKABLE_NUMBERINGS, true); rDoc.set(IDocumentSettingAccess::CLIPPED_PICTURES, true); + rDoc.set(IDocumentSettingAccess::TAB_OVER_MARGIN, true); // // COMPATIBILITY FLAGS END diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index fcca6d8cf854..9b1b9927359e 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1156,6 +1156,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC aSet.insert(String("UnbreakableNumberings", RTL_TEXTENCODING_ASCII_US)); aSet.insert(String("BackgroundParaOverDrawings", RTL_TEXTENCODING_ASCII_US)); aSet.insert(String("ClippedPictures", RTL_TEXTENCODING_ASCII_US)); + aSet.insert(String("TabOverMargin", RTL_TEXTENCODING_ASCII_US)); sal_Int32 nCount = aConfigProps.getLength(); const PropertyValue* pValues = aConfigProps.getConstArray(); @@ -1189,6 +1190,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC bool bUnbreakableNumberings = false; bool bBackgroundParaOverDrawings = false; bool bClippedPictures = false; + bool bTabOverMargin = false; OUString sRedlineProtectionKey( RTL_CONSTASCII_USTRINGPARAM( "RedlineProtectionKey" ) ); @@ -1281,6 +1283,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC bBackgroundParaOverDrawings = true; else if( pValues->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ClippedPictures")) ) bClippedPictures = true; + else if ( pValues->Name == "TabOverMargin" ) + bTabOverMargin = true; } catch( Exception& ) { @@ -1467,6 +1471,12 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC OUString( RTL_CONSTASCII_USTRINGPARAM("ClippedPictures") ), makeAny( false ) ); } + if ( !bBackgroundParaOverDrawings ) + xProps->setPropertyValue("BackgroundParaOverDrawings", makeAny( false ) ); + + if ( !bTabOverMargin ) + xProps->setPropertyValue("TabOverMargin", makeAny( false ) ); + Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); Reference < XText > xText = xTextDoc->getText(); Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY); diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index fdbe7b2fcb4e..383740fa9612 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -129,7 +129,8 @@ enum SwDocumentSettingsPropertyHandles HANDLE_FLOATTABLE_NOMARGINS, HANDLE_BACKGROUND_PARA_OVER_DRAWINGS, HANDLE_CLIPPED_PICTURES, - HANDLE_STYLES_NODEFAULT + HANDLE_STYLES_NODEFAULT, + HANDLE_TAB_OVER_MARGIN, }; MasterPropertySetInfo * lcl_createSettingsInfo() @@ -196,6 +197,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo() { RTL_CONSTASCII_STRINGPARAM("BackgroundParaOverDrawings"), HANDLE_BACKGROUND_PARA_OVER_DRAWINGS, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("ClippedPictures"), HANDLE_CLIPPED_PICTURES, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("StylesNoDefault"), HANDLE_STYLES_NODEFAULT, CPPUTYPE_BOOLEAN, 0, 0}, + { RTL_CONSTASCII_STRINGPARAM("TabOverMargin"), HANDLE_TAB_OVER_MARGIN, 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 @@ -779,6 +781,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf mpDoc->set(IDocumentSettingAccess::STYLES_NODEFAULT, bTmp); } break; + case HANDLE_TAB_OVER_MARGIN: + { + sal_Bool bTmp = *(sal_Bool*)rValue.getValue(); + mpDoc->set(IDocumentSettingAccess::TAB_OVER_MARGIN, bTmp); + } + break; default: throw UnknownPropertyException(); } @@ -1175,6 +1183,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf rValue.setValue( &bTmp, ::getBooleanCppuType() ); } break; + case HANDLE_TAB_OVER_MARGIN: + { + sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::TAB_OVER_MARGIN ); + rValue.setValue( &bTmp, ::getBooleanCppuType() ); + } + break; default: throw UnknownPropertyException(); } diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx index 47e663fe4d27..dc4a18710436 100644 --- a/writerfilter/source/filter/ImportFilter.cxx +++ b/writerfilter/source/filter/ImportFilter.cxx @@ -200,6 +200,7 @@ void WriterFilter::setTargetDocument( const uno::Reference< lang::XComponent >& xSettings->setPropertyValue(rtl::OUString::createFromAscii("FloattableNomargins"), uno::makeAny( sal_True )); xSettings->setPropertyValue( rtl::OUString::createFromAscii("BackgroundParaOverDrawings"), uno::makeAny( sal_True ) ); xSettings->setPropertyValue( rtl::OUString::createFromAscii( "ClippedPictures" ), uno::makeAny( sal_True ) ); + xSettings->setPropertyValue( "TabOverMargin", uno::makeAny( sal_True ) ); // Don't load the default style definitions to avoid weird mix xSettings->setPropertyValue( "StylesNoDefault", uno::makeAny( sal_True ) ); } |