From 6ba9daac763baf37c833911be5e5fb97e068bea1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 14 Mar 2022 12:28:06 +0200 Subject: add TypedWhichId version of QueryState Change-Id: I95b86fc081847da01e06f50a1b2c7e7f5456c638 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131529 Tested-by: Jenkins Reviewed-by: Noel Grandin --- desktop/source/lib/init.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'desktop') diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0e1c47e9b5dc..c8fd1be5ce88 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -771,17 +771,17 @@ void ExecuteOrientationChange() mxUndoManager->enterUndoContext( "" ); - const SfxPoolItem* pItem; + const SvxSizeItem* pSizeItem; + SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_SIZE, pSizeItem); + std::unique_ptr pPageSizeItem(pSizeItem->Clone()); + const SvxLongLRSpaceItem* pLRSpaceItem; + SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_LRSPACE, pLRSpaceItem); + std::unique_ptr pPageLRMarginItem(pLRSpaceItem->Clone()); - SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_SIZE, pItem); - std::unique_ptr pPageSizeItem(&pItem->Clone()->StaticWhichCast(SID_ATTR_PAGE_SIZE)); - - SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_LRSPACE, pItem); - std::unique_ptr pPageLRMarginItem(&pItem->Clone()->StaticWhichCast(SID_ATTR_PAGE_LRSPACE)); - - SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_ULSPACE, pItem); - std::unique_ptr pPageULMarginItem(&pItem->Clone()->StaticWhichCast(SID_ATTR_PAGE_ULSPACE)); + const SvxLongULSpaceItem* pULSpaceItem; + SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PAGE_ULSPACE, pULSpaceItem); + std::unique_ptr pPageULMarginItem(pULSpaceItem->Clone()); { bool bIsLandscape = false; -- cgit