Kaydet (Commit) c40b3937 authored tarafından Regina Henschel's avatar Regina Henschel Kaydeden (comit) Thorsten Behrens

tdf#123440 new expert option 'WriteLayerStateAsConfigItem'

LibreOffice writes the ODF attributes 'display' and 'protected' of
the 'layer' element since version 6.2. It can read the ODF
attributes since version 6.2. But they are only evaluated if non of
the config items VisibleLayers, PrintableLayers and LockedLayers
exists. If the option is set to 'false' no config items are written
and so reading of ODF attributes is forced. Version 6.1 is the last
one which needs the config items. So until version 6.1 is end of
life the default value is 'true'.
The patch introduces this option and adapts the relevant unit
tests to consider the option.

Change-Id: I2f8fc61506b14820f6bee8bf153d89363690b9e8
Reviewed-on: https://gerrit.libreoffice.org/67784
Tested-by: Jenkins
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst b48a2741
......@@ -5403,6 +5403,15 @@
</info>
<value>false</value>
</prop>
<prop oor:name="WriteLayerStateAsConfigItem" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>If 'true', the config items VisibleLayers, PrintableLayers and
LockedLayers are written to 'office:settings' element, otherwise not.
Since LO 6.2 the ODF attributes of 'draw:layer' element are used on
file open, if these config items do not exist.</desc>
</info>
<value>true</value>
</prop>
<prop oor:name="ExperimentalMode" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Determines if various experimental, and potentially unstable
......
......@@ -118,6 +118,10 @@ $(eval $(call gb_CppunitTest_use_components,sd_misc_tests,\
xmlsecurity/util/xmlsecurity \
))
$(eval $(call gb_CppunitTest_use_custom_headers,sd_misc_tests,\
officecfg/registry \
))
$(eval $(call gb_CppunitTest_use_configuration,sd_misc_tests))
# vim: set noet sw=4 ts=4:
This diff is collapsed.
......@@ -42,6 +42,7 @@
#include <framework/FrameworkHelper.hxx>
#include <comphelper/processfactory.hxx>
#include <sfx2/viewfrm.hxx>
#include <officecfg/Office/Common.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
......@@ -395,16 +396,19 @@ void FrameView::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert
aUserData.addValue( sUNO_View_EliminatePolyPointLimitAngle, makeAny( static_cast<sal_Int32>(GetEliminatePolyPointLimitAngle()) ) );
aUserData.addValue( sUNO_View_IsEliminatePolyPoints, makeAny( IsEliminatePolyPoints() ) );
SdrLayerAdmin& rLayerAdmin = getSdrModelFromSdrView().GetLayerAdmin();
Any aAny;
rLayerAdmin.QueryValue(GetVisibleLayers(), aAny);
aUserData.addValue( sUNO_View_VisibleLayers, aAny );
if ( officecfg::Office::Common::Misc::WriteLayerStateAsConfigItem::get() )
{
SdrLayerAdmin& rLayerAdmin = getSdrModelFromSdrView().GetLayerAdmin();
Any aAny;
rLayerAdmin.QueryValue(GetVisibleLayers(), aAny);
aUserData.addValue( sUNO_View_VisibleLayers, aAny );
rLayerAdmin.QueryValue(GetPrintableLayers(), aAny);
aUserData.addValue( sUNO_View_PrintableLayers, aAny );
rLayerAdmin.QueryValue(GetPrintableLayers(), aAny);
aUserData.addValue( sUNO_View_PrintableLayers, aAny );
rLayerAdmin.QueryValue(GetLockedLayers(), aAny);
aUserData.addValue( sUNO_View_LockedLayers, aAny );
rLayerAdmin.QueryValue(GetLockedLayers(), aAny);
aUserData.addValue( sUNO_View_LockedLayers, aAny );
}
aUserData.addValue( sUNO_View_NoAttribs, makeAny( IsNoAttribs() ) );
aUserData.addValue( sUNO_View_NoColors, makeAny( IsNoColors() ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment