28#include <rtl/character.hxx>
51 SfxItemState eState = pViewFrm->GetBindings().GetDispatcher()->QueryState(SID_ATTR_METRIC, pItem);
52 if (pItem && eState >= SfxItemState::DEFAULT)
61 sal_uInt16 nWhich = rPool.
GetWhich( SID_ATTR_PAGE_SIZE );
69 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"modules/swriter/ui/pagesizecontrol.ui",
"PageSizeControl")
70 , mxMoreButton(m_xBuilder->weld_button(
"moreoptions"))
71 , mxWidthHeightField(m_xBuilder->weld_metric_spin_button(
"metric",
FieldUnit::
CM))
72 , mxSizeValueSet(new
svx::sidebar::ValueSetWithTextControl)
73 , mxSizeValueSetWin(new
weld::CustomWeld(*m_xBuilder,
"pagesizevalueset", *mxSizeValueSet))
94 sal_uInt16 nSelectedItem = 0;
99 for (
short i = aText.getLength() - 1;
i >= 0;
i--)
102 if ( rtl::isAsciiAlpha(c) || (c ==
'\'') || (c ==
'\"') || (c ==
'%') )
104 aMetricStr = OUStringChar(c) + aMetricStr;
108 if (!aMetricStr.isEmpty())
116 bool bLandscape =
false;
121 pViewFrm->GetBindings().GetDispatcher()->QueryState( SID_ATTR_PAGE, pPageItem );
123 pViewFrm->GetBindings().GetDispatcher()->QueryState( SID_ATTR_PAGE_SIZE, pSize );
130 for ( std::vector< Paper >::size_type nPaperIdx = 0;
141 aWidthStr = localeDataWrapper.
getNum(
148 aHeightStr = localeDataWrapper.
getNum(
154 aItemText2 = aWidthStr +
" x " + aHeightStr +
" " + aMetricStr;
160 if ( pSize && aPaperSize == pSize->
GetSize() )
162 nSelectedItem = nPaperIdx + 1;
191 bool bLandscape =
false;
207 aPageSizeItem.
SetSize( aPageSize );
210 SfxCallMode::RECORD, { &aPageSizeItem });
216 mxSizeValueSet->SetNoSelection();
217 const sal_uInt16 nSelectedPaper = mxSizeValueSet->GetSelectedItemId();
218 const Paper ePaper = maPaperList[nSelectedPaper - 1];
219 ExecuteSizeChange( ePaper );
221 mxControl->EndPopupMode();
228 mxControl->EndPopupMode();
SfxApplication * SfxGetpApp()
const LocaleDataWrapper & GetLocaleDataWrapper() const
static const AllSettings & GetSettings()
sal_uInt16 GetValue() const
OUString getNum(sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep=true, bool bTrailingZeros=true) const
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)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
static FieldUnit GetCurrentFieldUnit()
SfxItemPool & GetPool() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static OUString GetName(Paper ePaper)
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
const Size & GetSize() const
void SetSize(const Size &rSize)
#define FN_FORMAT_PAGE_SETTING_DLG
#define LINK(Instance, Class, Member)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)
#define WB_NO_DIRECTSELECT