diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-26 18:13:54 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-31 16:18:43 +0200 |
commit | 115577b1c3cf42f4831d79be41f512fa21383832 (patch) | |
tree | e2cc2144d3587605f78dea026813c5806795ba32 | |
parent | 0a73929a8225227fe540c5920c15382bc61dec61 (diff) |
tdf#108056 sw: add UI to disable SubtractFlysAnchoredAtFlys compat option
There is a reason this is off by default, make it a bit more easier for
users to not depend this option when they don't actually need it.
(cherry picked from commit f85ded43446b17fbfdd868cc057ba39666d3d7cb)
Conflicts:
include/unotools/compatibility.hxx
officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
sw/inc/viewsh.hxx
sw/source/ui/config/optcomp.cxx
sw/uiconfig/swriter/ui/optcompatpage.ui
unotools/source/config/compatibility.cxx
Change-Id: I21c5b942c6021fa21840779e1a9f53055fbf279f
Reviewed-on: https://gerrit.libreoffice.org/38081
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r-- | include/unotools/compatibility.hxx | 7 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs | 6 | ||||
-rw-r--r-- | sw/inc/viewsh.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/config/optcomp.cxx | 29 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/optcompatpage.ui | 1 | ||||
-rw-r--r-- | unotools/source/config/compatibility.cxx | 24 |
7 files changed, 59 insertions, 16 deletions
diff --git a/include/unotools/compatibility.hxx b/include/unotools/compatibility.hxx index 229190c42415..8f4ce5a2ee12 100644 --- a/include/unotools/compatibility.hxx +++ b/include/unotools/compatibility.hxx @@ -40,7 +40,8 @@ enum CompatibilityOptions COPT_USE_OUR_TEXTWRAPPING, COPT_CONSIDER_WRAPPINGSTYLE, COPT_EXPAND_WORDSPACE, - COPT_PROTECT_FORM + COPT_PROTECT_FORM, + COPT_SUBTRACT_FLYS_ANCHORED_AT_FLYS }; /*-************************************************************************************************************ @@ -61,6 +62,7 @@ enum CompatibilityOptions #define COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE "ConsiderWrappingStyle" #define COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE "ExpandWordSpace" #define COMPATIBILITY_PROPERTYNAME_PROTECTFORM "ProtectForm" +#define COMPATIBILITY_PROPERTYNAME_SUBTRACT_FLYS_ANCHORED_AT_FLYS "SubtractFlysAnchoredAtFlys" #define COMPATIBILITY_DEFAULT_NAME "_default" @@ -132,7 +134,8 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options bool bUseOurTextWrapping, bool bConsiderWrappingStyle, bool bExpandWordSpace, - bool bProtectForm ); + bool bProtectForm, + bool bSubtractFlysAnchoredAtFlys ); bool IsUsePrtDevice() const; bool IsAddSpacing() const; diff --git a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs index 12179ba285d1..365f282d85b7 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs @@ -104,6 +104,12 @@ </info> <value>true</value> </prop> + <prop oor:name="SubtractFlysAnchoredAtFlys" oor:type="xs:boolean" oor:nillable="false"> + <info> + <desc>Use LibreOffice 4.3 anchoring paint order</desc> + </info> + <value>false</value> + </prop> </group> </templates> <component> diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 1d5a34b6c343..7dc28460c20a 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -416,6 +416,8 @@ public: void SetProtectForm( bool _bProtectForm ); + void SetSubtractFlysAnchoredAtFlys(bool bSubtractFlysAnchoredAtFlys); + // DOCUMENT COMPATIBILITY FLAGS END // Calls Idle-formatter of Layout. diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 8e05c85e7653..923ed6205876 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -899,6 +899,12 @@ void SwViewShell::SetProtectForm( bool _bProtectForm ) } +void SwViewShell::SetSubtractFlysAnchoredAtFlys(bool bSubtractFlysAnchoredAtFlys) +{ + IDocumentSettingAccess& rIDSA = getIDocumentSettingAccess(); + rIDSA.set(DocumentSettingId::SUBTRACT_FLYS, bSubtractFlysAnchoredAtFlys); +} + void SwViewShell::Reformat() { SwWait aWait( *GetDoc()->GetDocShell(), true ); diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index 2e72a027984b..65c826fd62ed 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -57,13 +57,14 @@ struct CompatibilityItem bool m_bConsiderWrappingStyle; bool m_bExpandWordSpace; bool m_bProtectForm; + bool m_bSubtractFlysAnchoredAtFlys; bool m_bIsDefault; CompatibilityItem( const OUString& _rName, const OUString& _rModule, bool _bUsePrtMetrics, bool _bAddSpacing, bool _bAddSpacingAtPages, bool _bUseOurTabStops, bool _bNoExtLeading, bool _bUseLineSpacing, bool _bAddTableSpacing, bool _bUseObjPos, bool _bUseOurTextWrapping, - bool _bConsiderWrappingStyle, bool _bExpandWordSpace, bool _bProtectForm, + bool _bConsiderWrappingStyle, bool _bExpandWordSpace, bool _bProtectForm, bool _bSubtractFlysAnchoredAtFlys, bool _bIsDefault ) : m_sName ( _rName ), @@ -80,6 +81,7 @@ struct CompatibilityItem m_bConsiderWrappingStyle( _bConsiderWrappingStyle ), m_bExpandWordSpace ( _bExpandWordSpace ), m_bProtectForm ( _bProtectForm), + m_bSubtractFlysAnchoredAtFlys ( _bSubtractFlysAnchoredAtFlys), m_bIsDefault ( _bIsDefault ) {} }; @@ -102,7 +104,7 @@ SwCompatibilityOptPage::SwCompatibilityOptPage(vcl::Window* pParent, const SfxIt get(m_pOptionsLB, "options"); get(m_pDefaultPB, "default"); - for (sal_Int32 nId = COPT_USE_PRINTERDEVICE; nId <= COPT_PROTECT_FORM; ++nId) + for (sal_Int32 nId = COPT_USE_PRINTERDEVICE; nId <= COPT_SUBTRACT_FLYS_ANCHORED_AT_FLYS; ++nId) { const OUString sEntry = m_pFormattingLB->GetEntry(nId); SvTreeListEntry* pEntry = m_pOptionsLB->SvTreeListBox::InsertEntry( sEntry ); @@ -153,7 +155,8 @@ sal_uLong convertBools2Ulong_Impl bool _bUseOurTextWrapping, bool _bConsiderWrappingStyle, bool _bExpandWordSpace, - bool _bProtectForm + bool _bProtectForm, + bool bSubtractFlysAnchoredAtFlys ) { sal_uLong nRet = 0; @@ -194,6 +197,9 @@ sal_uLong convertBools2Ulong_Impl nSetBit = nSetBit << 1; if ( _bProtectForm ) nRet |= nSetBit; + nSetBit = nSetBit << 1; + if (bSubtractFlysAnchoredAtFlys) + nRet |= nSetBit; return nRet; } @@ -235,6 +241,7 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) bool bConsiderWrappingStyle = false; bool bExpandWordSpace = false; bool bProtectForm = false; + bool bSubtractFlysAnchoredAtFlys = false; const sal_Int32 nCount = aList.getLength(); for ( sal_Int32 i = 0; i < nCount; ++i ) { @@ -271,6 +278,8 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) aValue.Value >>= bExpandWordSpace; else if ( aValue.Name == COMPATIBILITY_PROPERTYNAME_PROTECTFORM ) aValue.Value >>= bProtectForm; + else if ( aValue.Name == COMPATIBILITY_PROPERTYNAME_SUBTRACT_FLYS_ANCHORED_AT_FLYS ) + aValue.Value >>= bSubtractFlysAnchoredAtFlys; } const bool bIsUserEntry = sName == "_user"; @@ -280,7 +289,7 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) sName, sModule, bUsePrtMetrics, bAddSpacing, bAddSpacingAtPages, bUseOurTabStops, bNoExtLeading, bUseLineSpacing, bAddTableSpacing, bUseObjPos, - bUseOurTextWrapping, bConsiderWrappingStyle, bExpandWordSpace, bProtectForm, + bUseOurTextWrapping, bConsiderWrappingStyle, bExpandWordSpace, bProtectForm, bSubtractFlysAnchoredAtFlys, bIsDefaultEntry ); m_pImpl->m_aList.push_back( aItem ); @@ -306,7 +315,7 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) bUsePrtMetrics, bAddSpacing, bAddSpacingAtPages, bUseOurTabStops, bNoExtLeading, bUseLineSpacing, bAddTableSpacing, bUseObjPos, bUseOurTextWrapping, - bConsiderWrappingStyle, bExpandWordSpace, bProtectForm ); + bConsiderWrappingStyle, bExpandWordSpace, bProtectForm, bSubtractFlysAnchoredAtFlys ); m_pFormattingLB->SetEntryData( nPos, reinterpret_cast<void*>((sal_IntPtr)nOptions) ); } @@ -394,7 +403,8 @@ sal_uLong SwCompatibilityOptPage::GetDocumentOptions() const rIDocumentSettingAccess.get(DocumentSettingId::USE_FORMER_TEXT_WRAPPING), rIDocumentSettingAccess.get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION), !rIDocumentSettingAccess.get(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK), - rIDocumentSettingAccess.get(DocumentSettingId::PROTECT_FORM)); + rIDocumentSettingAccess.get(DocumentSettingId::PROTECT_FORM), + rIDocumentSettingAccess.get( DocumentSettingId::SUBTRACT_FLYS )); } return nRet; } @@ -410,7 +420,7 @@ void SwCompatibilityOptPage::WriteOptions() pItem->m_bNoExtLeading, pItem->m_bUseLineSpacing, pItem->m_bAddTableSpacing, pItem->m_bUseObjPos, pItem->m_bUseOurTextWrapping, pItem->m_bConsiderWrappingStyle, - pItem->m_bExpandWordSpace, pItem->m_bProtectForm ); + pItem->m_bExpandWordSpace, pItem->m_bProtectForm, pItem->m_bSubtractFlysAnchoredAtFlys ); } VclPtr<SfxTabPage> SwCompatibilityOptPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ) @@ -488,6 +498,11 @@ bool SwCompatibilityOptPage::FillItemSet( SfxItemSet* ) m_pWrtShell->SetProtectForm( bChecked ); bModified = true; } + else if ( COPT_SUBTRACT_FLYS_ANCHORED_AT_FLYS == nOption ) + { + m_pWrtShell->SetSubtractFlysAnchoredAtFlys( bChecked ); + bModified = true; + } } nSavedOptions = nSavedOptions >> 1; diff --git a/sw/uiconfig/swriter/ui/optcompatpage.ui b/sw/uiconfig/swriter/ui/optcompatpage.ui index 4ba4e48f1b72..9675da0782be 100644 --- a/sw/uiconfig/swriter/ui/optcompatpage.ui +++ b/sw/uiconfig/swriter/ui/optcompatpage.ui @@ -65,6 +65,7 @@ <item translatable="yes">Consider wrapping style when positioning objects</item> <item translatable="yes">Expand word space on lines with manual line breaks in justified paragraphs</item> <item translatable="yes">Protect form</item> + <item translatable="yes">Use LibreOffice 4.3 anchoring paint order (in current document)</item> <item translatable="yes"><User settings></item> </items> </object> diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx index cd86de8b32e8..ef15a7bdfd01 100644 --- a/unotools/source/config/compatibility.cxx +++ b/unotools/source/config/compatibility.cxx @@ -57,8 +57,9 @@ using namespace ::com::sun::star::beans; #define PROPERTYNAME_CONSIDERWRAPSTYLE COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE #define PROPERTYNAME_EXPANDWORDSPACE COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE #define PROPERTYNAME_PROTECTFORM COMPATIBILITY_PROPERTYNAME_PROTECTFORM +#define PROPERTYNAME_SUBTRACT_FLYS_ANCHORED_AT_FLYS COMPATIBILITY_PROPERTYNAME_SUBTRACT_FLYS_ANCHORED_AT_FLYS -#define PROPERTYCOUNT 14 +#define PROPERTYCOUNT 15 #define OFFSET_NAME 0 #define OFFSET_MODULE 1 @@ -74,6 +75,7 @@ using namespace ::com::sun::star::beans; #define OFFSET_CONSIDERWRAPPINGSTYLE 11 #define OFFSET_EXPANDWORDSPACE 12 #define OFFSET_PROTECTFORM 13 +#define OFFSET_SUBTRACT_FLYS_ANCHORED_AT_FLYS 14 // private declarations! @@ -89,7 +91,7 @@ struct SvtCompatibilityEntry bNoExtLeading( false ), bUseLineSpacing( false ), bAddTableSpacing( false ), bUseObjPos( false ), bUseOurTextWrapping( false ), bConsiderWrappingStyle( false ), - bExpandWordSpace( true ), bProtectForm( false ) {} + bExpandWordSpace( true ), bProtectForm( false ), bSubtractFlysAnchoredAtFlys(false) {} SvtCompatibilityEntry( const OUString& _rName, const OUString& _rNewModule ) : sName( _rName ), sModule( _rNewModule ), @@ -98,7 +100,7 @@ struct SvtCompatibilityEntry bNoExtLeading( false ), bUseLineSpacing( false ), bAddTableSpacing( false ), bUseObjPos( false ), bUseOurTextWrapping( false ), bConsiderWrappingStyle( false ), - bExpandWordSpace( true ), bProtectForm( false ) {} + bExpandWordSpace( true ), bProtectForm( false ), bSubtractFlysAnchoredAtFlys(false) {} inline void SetUsePrtMetrics( bool _bSet ) { bUsePrtMetrics = _bSet; } inline void SetAddSpacing( bool _bSet ) { bAddSpacing = _bSet; } @@ -112,6 +114,7 @@ struct SvtCompatibilityEntry inline void SetConsiderWrappingStyle( bool _bSet ) { bConsiderWrappingStyle = _bSet; } inline void SetExpandWordSpace( bool _bSet ) { bExpandWordSpace = _bSet; } inline void SetProtectForm( bool _bSet ) { bProtectForm = _bSet; } + inline void SetSubtractFlysAnchoredAtFlys( bool _bSet ) { bSubtractFlysAnchoredAtFlys = _bSet; } public: OUString sName; @@ -128,6 +131,7 @@ struct SvtCompatibilityEntry bool bConsiderWrappingStyle; bool bExpandWordSpace; bool bProtectForm; + bool bSubtractFlysAnchoredAtFlys; }; /*-**************************************************************************************************************** @@ -261,7 +265,8 @@ class SvtCompatibilityOptions_Impl : public ConfigItem bool _bUseOurTextWrapping, bool _bConsiderWrappingStyle, bool _bExpandWordSpace, - bool _bProtectForm ); + bool _bProtectForm, + bool _bSubtractFlysAnchoredAtFlys ); inline bool IsUsePrtDevice() const { return m_aDefOptions.bUsePrtMetrics; } inline bool IsAddSpacing() const { return m_aDefOptions.bAddSpacing; } @@ -437,6 +442,7 @@ void SvtCompatibilityOptions_Impl::ImplCommit() lPropertyValues[ OFFSET_CONSIDERWRAPPINGSTYLE - 1 ].Name = sNode + PROPERTYNAME_CONSIDERWRAPSTYLE; lPropertyValues[ OFFSET_EXPANDWORDSPACE - 1 ].Name = sNode + PROPERTYNAME_EXPANDWORDSPACE; lPropertyValues[ OFFSET_PROTECTFORM - 1 ].Name = sNode + PROPERTYNAME_PROTECTFORM; + lPropertyValues[ OFFSET_SUBTRACT_FLYS_ANCHORED_AT_FLYS - 1 ].Name = sNode + PROPERTYNAME_SUBTRACT_FLYS_ANCHORED_AT_FLYS; lPropertyValues[ OFFSET_MODULE - 1 ].Value <<= aItem.sModule; lPropertyValues[ OFFSET_USEPRTMETRICS - 1 ].Value <<= aItem.bUsePrtMetrics; @@ -451,6 +457,7 @@ void SvtCompatibilityOptions_Impl::ImplCommit() lPropertyValues[ OFFSET_CONSIDERWRAPPINGSTYLE - 1 ].Value <<= aItem.bConsiderWrappingStyle; lPropertyValues[ OFFSET_EXPANDWORDSPACE - 1 ].Value <<= aItem.bExpandWordSpace; lPropertyValues[ OFFSET_PROTECTFORM - 1 ].Value <<= aItem.bProtectForm; + lPropertyValues[ OFFSET_SUBTRACT_FLYS_ANCHORED_AT_FLYS - 1 ].Value <<= aItem.bSubtractFlysAnchoredAtFlys; SetSetProperties( SETNODE_ALLFILEFORMATS, lPropertyValues ); } @@ -488,7 +495,8 @@ void SvtCompatibilityOptions_Impl::AppendItem( const OUString& _sName, bool _bUseOurTextWrapping, bool _bConsiderWrappingStyle, bool _bExpandWordSpace, - bool _bProtectForm ) + bool _bProtectForm, + bool _bSubtractFlysAnchoredAtFlys ) { SvtCompatibilityEntry aItem( _sName, _sModule ); aItem.SetUsePrtMetrics( _bUsePrtMetrics ); @@ -503,6 +511,7 @@ void SvtCompatibilityOptions_Impl::AppendItem( const OUString& _sName, aItem.SetConsiderWrappingStyle( _bConsiderWrappingStyle ); aItem.SetExpandWordSpace( _bExpandWordSpace ); aItem.SetProtectForm( _bProtectForm ); + aItem.SetSubtractFlysAnchoredAtFlys( _bSubtractFlysAnchoredAtFlys ); m_aOptions.AppendEntry( aItem ); // default item reset? @@ -631,14 +640,15 @@ void SvtCompatibilityOptions::AppendItem( const OUString& sName, bool bUseOurTextWrapping, bool bConsiderWrappingStyle, bool bExpandWordSpace, - bool bProtectForm ) + bool bProtectForm, + bool bSubtractFlysAnchoredAtFlys ) { MutexGuard aGuard( GetOwnStaticMutex() ); m_pImpl->AppendItem( sName, sModule, bUsePrtMetrics, bAddSpacing, bAddSpacingAtPages, bUseOurTabStops, bNoExtLeading, bUseLineSpacing, bAddTableSpacing, bUseObjPos, - bUseOurTextWrapping, bConsiderWrappingStyle, bExpandWordSpace, bProtectForm ); + bUseOurTextWrapping, bConsiderWrappingStyle, bExpandWordSpace, bProtectForm, bSubtractFlysAnchoredAtFlys ); } bool SvtCompatibilityOptions::IsUsePrtDevice() const |