From f08186baf39a85bb8c6b4b52e9b02e5970eb1384 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 3 Dec 2019 13:25:39 +0100 Subject: Use o3tl::doAccess, prevent -Werror=maybe-uninitialized (and do not unbox Any where it is not necessary anyway) Change-Id: Ic5461fb8b62157e9116cd2d557ee38fface28fb7 Reviewed-on: https://gerrit.libreoffice.org/84337 Tested-by: Jenkins Reviewed-by: Stephan Bergmann (cherry picked from commit 941d53eee9a186e790bb3203b37eeb5fa285d2c4) --- sw/source/uibase/app/docst.cxx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'sw/source/uibase/app/docst.cxx') diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 2e25b89ea9e6..580aee5ad8bd 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -24,7 +24,7 @@ #include #include - +#include #include #include #include @@ -717,21 +717,20 @@ void syncEndnoteOrientation(const uno::Reference< style::XStyleFamiliesSupplier return; } - sal_Int32 nWidth, nHeight; - bool bIsDefLandScape, bIsEndLandScape; - - xDefaultPagePropSet->getPropertyValue("IsLandscape") >>= bIsDefLandScape; - xEndnotePagePropSet->getPropertyValue("IsLandscape") >>= bIsEndLandScape; + auto const bIsDefLandScape = *o3tl::doAccess( + xDefaultPagePropSet->getPropertyValue("IsLandscape")); + auto const bIsEndLandScape = *o3tl::doAccess( + xEndnotePagePropSet->getPropertyValue("IsLandscape")); if (bIsDefLandScape == bIsEndLandScape) return; - xEndnotePagePropSet->getPropertyValue("Width") >>= nWidth; - xEndnotePagePropSet->getPropertyValue("Height") >>= nHeight; + auto const nWidth = xEndnotePagePropSet->getPropertyValue("Width"); + auto const nHeight = xEndnotePagePropSet->getPropertyValue("Height"); xEndnotePagePropSet->setPropertyValue("IsLandscape", css::uno::toAny(bIsDefLandScape)); - xEndnotePagePropSet->setPropertyValue("Width", css::uno::toAny(nHeight)); - xEndnotePagePropSet->setPropertyValue("Height", css::uno::toAny(nWidth)); + xEndnotePagePropSet->setPropertyValue("Width", nHeight); + xEndnotePagePropSet->setPropertyValue("Height", nWidth); } } -- cgit