28 #include <rtl/character.hxx>
51 if ( pItem && eState >= SfxItemState::DEFAULT )
66 sal_uInt16 nWhich = rPool.
GetWhich( SID_ATTR_PAGE_SIZE );
74 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"modules/swriter/ui/pagesizecontrol.ui",
"PageSizeControl")
75 , mxMoreButton(m_xBuilder->weld_button(
"moreoptions"))
76 , mxWidthHeightField(m_xBuilder->weld_metric_spin_button(
"metric",
FieldUnit::
CM))
77 , mxSizeValueSet(new
svx::sidebar::ValueSetWithTextControl)
78 , mxSizeValueSetWin(new
weld::CustomWeld(*m_xBuilder,
"pagesizevalueset", *mxSizeValueSet))
99 sal_uInt16 nSelectedItem = 0;
104 for (
short i = aText.getLength() - 1;
i >= 0;
i--)
107 if ( rtl::isAsciiAlpha(c) || (c ==
'\'') || (c ==
'\"') || (c ==
'%') )
109 aMetricStr = OUStringChar(c) + aMetricStr;
113 if (!aMetricStr.isEmpty())
121 bool bLandscape =
false;
135 for ( std::vector< Paper >::size_type nPaperIdx = 0;
146 aWidthStr = localeDataWrapper.
getNum(
153 aHeightStr = localeDataWrapper.
getNum(
159 aItemText2 = aWidthStr +
" x " + aHeightStr +
" " + aMetricStr;
165 if ( pSize && aPaperSize == pSize->
GetSize() )
167 nSelectedItem = nPaperIdx + 1;
195 bool bLandscape =
false;
210 aPageSizeItem.
SetSize( aPageSize );
213 SfxCallMode::RECORD, { &aPageSizeItem });
219 mxSizeValueSet->SetNoSelection();
220 const sal_uInt16 nSelectedPaper = mxSizeValueSet->GetSelectedItemId();
221 const Paper ePaper = maPaperList[nSelectedPaper - 1];
222 ExecuteSizeChange( ePaper );
224 mxControl->EndPopupMode();
231 mxControl->EndPopupMode();
#define LINK(Instance, Class, Member)
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
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 * >())
const LocaleDataWrapper & GetLocaleDataWrapper() const
SfxDispatcher * GetDispatcher()
static const AllSettings & GetSettings()
static FieldUnit GetCurrentFieldUnit()
sal_uInt16 GetValue() const
SfxApplication * SfxGetpApp()
constexpr tools::Long Width() const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemPool & GetPool() const
#define FN_FORMAT_PAGE_SETTING_DLG
SfxBindings & GetBindings()
static OUString GetName(Paper ePaper)
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
static SfxViewFrame * Current()
#define WB_NO_DIRECTSELECT
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
constexpr tools::Long Height() const
void SetSize(const Size &rSize)
SfxDispatcher * GetDispatcher() const
OUString getNum(sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep=true, bool bTrailingZeros=true) const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const Size & GetSize() const