23#include <com/sun/star/document/XUndoManager.hpp>
24#include <com/sun/star/document/XUndoManagerSupplier.hpp>
25#include <com/sun/star/frame/XFrame.hpp>
33 css::uno::Reference< css::document::XUndoManager > getUndoManager(
const css::uno::Reference< css::frame::XFrame >& rxFrame )
35 const css::uno::Reference< css::frame::XController >&
xController = rxFrame->getController();
38 const css::uno::Reference< css::frame::XModel >&
xModel =
xController->getModel();
41 const css::uno::Reference< css::document::XUndoManagerSupplier > xSuppUndo( xModel, css::uno::UNO_QUERY_THROW );
42 return css::uno::Reference< css::document::XUndoManager >( xSuppUndo->getUndoManager(), css::uno::UNO_SET_THROW );
46 return css::uno::Reference< css::document::XUndoManager > ();
53 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"modules/swriter/ui/pageorientationcontrol.ui",
"PageOrientationControl")
54 , m_xPortrait(m_xBuilder->weld_button(
"portrait"))
55 , m_xLandscape(m_xBuilder->weld_button(
"landscape"))
58 , mpPageSizeItem( new
SvxSizeItem(SID_ATTR_PAGE_SIZE) )
82 pViewFrm->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_LRSPACE,
93 pViewFrm->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_ULSPACE,
103 css::uno::Reference< css::document::XUndoManager > mxUndoManager(
106 if ( mxUndoManager.is() )
107 mxUndoManager->enterUndoContext(
"" );
116 if ( mxUndoManager.is() )
117 mxUndoManager->leaveUndoContext();
183 if ( mxUndoManager.is() )
184 mxUndoManager->leaveUndoContext();
189 if (&rControl == m_xPortrait.get())
190 ExecuteOrientationChange(
false );
192 ExecuteOrientationChange(
true );
constexpr tools::Long MINBODY
SfxDispatcher * GetDispatcher() const
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
SfxFrame & GetFrame() const
virtual SvxLongLRSpaceItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual SvxLongULSpaceItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual SvxSizeItem * Clone(SfxItemPool *pPool=nullptr) const override
#define LINK(Instance, Class, Member)
Reference< XController > xController
Reference< XModel > xModel