20#undef SC_DLLIMPLEMENTATION
24#include <osl/diagnose.h>
29#include <bitmaps.hlst>
34 svl::Items<ATTR_PAGE_NOTES, ATTR_PAGE_FIRSTPAGENO>);
55 sal_uInt16 nOrigScalePageWidth,
57 sal_uInt16 nOrigScalePageHeight );
75bool WAS_DEFAULT(sal_uInt16 w,
SfxItemSet const & s)
81#define SC_TPTABLE_SCALE_PERCENT 0
82#define SC_TPTABLE_SCALE_TO 1
83#define SC_TPTABLE_SCALE_TO_PAGES 2
86 :
SfxTabPage(pPage, pController,
"modules/scalc/ui/sheetprintpage.ui",
"SheetPrintPage", &rCoreAttrs)
87 , m_nOrigScalePageWidth(0)
88 , m_nOrigScalePageHeight(0)
89 , m_xBtnTopDown(m_xBuilder->weld_radio_button(
"radioBTN_TOPDOWN"))
90 , m_xBtnLeftRight(m_xBuilder->weld_radio_button(
"radioBTN_LEFTRIGHT"))
91 , m_xBmpPageDir(m_xBuilder->weld_image(
"imageBMP_PAGEDIR"))
92 , m_xBtnPageNo(m_xBuilder->weld_check_button(
"checkBTN_PAGENO"))
93 , m_xEdPageNo(m_xBuilder->weld_spin_button(
"spinED_PAGENO"))
94 , m_xBtnHeaders(m_xBuilder->weld_check_button(
"checkBTN_HEADER"))
95 , m_xBtnGrid(m_xBuilder->weld_check_button(
"checkBTN_GRID"))
96 , m_xBtnNotes(m_xBuilder->weld_check_button(
"checkBTN_NOTES"))
97 , m_xBtnObjects(m_xBuilder->weld_check_button(
"checkBTN_OBJECTS"))
98 , m_xBtnCharts(m_xBuilder->weld_check_button(
"checkBTN_CHARTS"))
99 , m_xBtnDrawings(m_xBuilder->weld_check_button(
"checkBTN_DRAWINGS"))
100 , m_xBtnFormulas(m_xBuilder->weld_check_button(
"checkBTN_FORMULAS"))
101 , m_xBtnNullVals(m_xBuilder->weld_check_button(
"checkBTN_NULLVALS"))
102 , m_xLbScaleMode(m_xBuilder->weld_combo_box(
"comboLB_SCALEMODE"))
103 , m_xBxScaleAll(m_xBuilder->weld_widget(
"boxSCALEALL"))
104 , m_xEdScaleAll(m_xBuilder->weld_metric_spin_button(
"spinED_SCALEALL",
FieldUnit::
PERCENT))
105 , m_xGrHeightWidth(m_xBuilder->weld_widget(
"gridWH"))
106 , m_xEdScalePageWidth(m_xBuilder->weld_spin_button(
"spinED_SCALEPAGEWIDTH"))
107 , m_xCbScalePageWidth(m_xBuilder->weld_check_button(
"labelWP"))
108 , m_xEdScalePageHeight(m_xBuilder->weld_spin_button(
"spinED_SCALEPAGEHEIGHT"))
109 , m_xCbScalePageHeight(m_xBuilder->weld_check_button(
"labelHP"))
110 , m_xBxScalePageNum(m_xBuilder->weld_widget(
"boxNP"))
111 , m_xEdScalePageNum(m_xBuilder->weld_spin_button(
"spinED_SCALEPAGENUM"))
125 OUString aImg(
m_xBtnLeftRight->get_active() ? OUString(BMP_LEFTRIGHT) : OUString(BMP_TOPDOWN));
135 return std::make_unique<ScTablePage>(pPage, pController, *rCoreSet);
154 m_xEdPageNo->set_value( (nPage != 0) ? nPage : 1 );
164 if ( rCoreSet->
GetItemState( nWhichPageScale ) >= SfxItemState::DEFAULT )
166 sal_uInt16 nScale = rCoreSet->
Get(nWhichPageScale).GetValue();
169 m_xEdScaleAll->set_value((nScale > 0) ? nScale : 100, FieldUnit::PERCENT);
173 if ( rCoreSet->
GetItemState( nWhichScaleTo ) >= SfxItemState::DEFAULT )
176 sal_uInt16 nWidth = rItem.
GetWidth();
181 if (nWidth || nHeight)
184 nWidth = nHeight = 1;
204 if ( rCoreSet->
GetItemState( nWhichScale ) >= SfxItemState::DEFAULT )
206 sal_uInt16 nPages = rCoreSet->
Get(nWhichScale).GetValue();
215 OSL_FAIL(
"ScTablePage::Reset - missing scaling item" );
247 bool bDataChanged =
false;
283 if ( WAS_DEFAULT(nWhichPageNo,rOldSet)
284 && ( (!bUseValue && 0 ==
m_xBtnPageNo->get_saved_state())
286 && !
m_xEdPageNo->get_value_changed_from_saved() ) ) )
292 sal_uInt16 nPage =
static_cast<sal_uInt16
>(
m_xBtnPageNo->get_active()
341 return DeactivateRC::LeavePage;
382 if (&rBox == m_xCbScalePageWidth.get())
384 if (!rBox.get_active())
386 m_xEdScalePageWidth->set_text(OUString());
387 m_xEdScalePageWidth->set_sensitive(
false);
391 m_xEdScalePageWidth->set_value(1);
392 m_xEdScalePageWidth->set_sensitive(
true);
397 if (!rBox.get_active())
399 m_xEdScalePageHeight->set_text(OUString());
400 m_xEdScalePageHeight->set_sensitive(
false);
404 m_xEdScalePageHeight->set_value(1);
405 m_xEdScalePageHeight->set_sensitive(
true);
418 bool bDataChanged = ( bSavedValue == bIsChecked
419 && WAS_DEFAULT(nWhich,rOldSet) );
436 && WAS_DEFAULT(nWhich,rOldSet);
456 bool bIsSel = (rListBox.
get_active() == nLBEntry);
459 !WAS_DEFAULT( nWhich, rOldSet );
475 sal_uInt16 nOrigScalePageWidth,
477 sal_uInt16 nOrigScalePageHeight )
481 bool bIsSel = (rListBox.
get_active() == nLBEntry);
483 nValue1 != nOrigScalePageWidth ||
484 nValue1 != nOrigScalePageHeight ||
485 !WAS_DEFAULT( nWhich, rOldSet );
491 aItem.
Set( nValue1, nValue2 );
492 rCoreSet.
Put( aItem );
508 bool bIsSel = (rListBox.
get_active() == nLBEntry);
511 !WAS_DEFAULT( nWhich, rOldSet );
Contains the "scale to width/height" attribute in page styles.
void Set(sal_uInt16 nWidth, sal_uInt16 nHeight)
sal_uInt16 GetHeight() const
sal_uInt16 GetWidth() const
std::unique_ptr< weld::CheckButton > m_xBtnCharts
ScTablePage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreSet)
std::unique_ptr< weld::CheckButton > m_xBtnObjects
std::unique_ptr< weld::SpinButton > m_xEdScalePageWidth
std::unique_ptr< weld::CheckButton > m_xBtnGrid
std::unique_ptr< weld::CheckButton > m_xBtnNotes
std::unique_ptr< weld::CheckButton > m_xBtnPageNo
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rCoreSet)
std::unique_ptr< weld::ComboBox > m_xLbScaleMode
std::unique_ptr< weld::SpinButton > m_xEdPageNo
std::unique_ptr< weld::CheckButton > m_xBtnDrawings
std::unique_ptr< weld::MetricSpinButton > m_xEdScaleAll
std::unique_ptr< weld::SpinButton > m_xEdScalePageNum
sal_uInt16 m_nOrigScalePageWidth
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
virtual ~ScTablePage() override
std::unique_ptr< weld::SpinButton > m_xEdScalePageHeight
std::unique_ptr< weld::CheckButton > m_xBtnHeaders
std::unique_ptr< weld::CheckButton > m_xCbScalePageHeight
std::unique_ptr< weld::RadioButton > m_xBtnTopDown
std::unique_ptr< weld::Image > m_xBmpPageDir
sal_uInt16 m_nOrigScalePageHeight
virtual void Reset(const SfxItemSet *rCoreSet) override
std::unique_ptr< weld::CheckButton > m_xBtnNullVals
std::unique_ptr< weld::CheckButton > m_xCbScalePageWidth
virtual bool FillItemSet(SfxItemSet *rCoreSet) override
std::unique_ptr< weld::CheckButton > m_xBtnFormulas
void PageNoHdl(const weld::Toggleable *pBtn)
std::unique_ptr< weld::RadioButton > m_xBtnLeftRight
static const WhichRangesContainer pPageTableRanges
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const SfxItemSet & GetItemSet() const
void SetExchangeSupport()
bool get_value_changed_from_saved() const
virtual int get_active() const=0
bool get_value_changed_from_saved() const
virtual bool get_active() const=0
TriState get_saved_state() const
#define LINK(Instance, Class, Member)
#define SID_SCATTR_PAGE_HEADERS
#define SID_SCATTR_PAGE_GRID
#define SID_SCATTR_PAGE_NOTES
#define SID_SCATTR_PAGE_SCALETO
#define SID_SCATTR_PAGE_DRAWINGS
#define SID_SCATTR_PAGE_FORMULAS
#define SID_SCATTR_PAGE_OBJECTS
#define SID_SCATTR_PAGE_SCALE
#define SID_SCATTR_PAGE_CHARTS
#define SID_SCATTR_PAGE_NULLVALS
#define SID_SCATTR_PAGE_SCALETOPAGES
#define SID_SCATTR_PAGE_FIRSTPAGENO
#define SID_SCATTR_PAGE_TOPDOWN
#define SC_TPTABLE_SCALE_TO
#define SC_TPTABLE_SCALE_PERCENT
#define SC_TPTABLE_SCALE_TO_PAGES
static bool lcl_PutScaleItem2(TypedWhichId< ScPageScaleToItem > nWhich, SfxItemSet &rCoreSet, const SfxItemSet &rOldSet, const weld::ComboBox &rListBox, sal_uInt16 nLBEntry, const weld::SpinButton &rEd1, sal_uInt16 nOrigScalePageWidth, const weld::SpinButton &rEd2, sal_uInt16 nOrigScalePageHeight)
IMPL_LINK_NOARG(ScTablePage, PageDirHdl, weld::Toggleable &, void)
static bool lcl_PutScaleItem(TypedWhichId< SfxUInt16Item > nWhich, SfxItemSet &rCoreSet, const SfxItemSet &rOldSet, const weld::ComboBox &rListBox, sal_uInt16 nLBEntry, const weld::MetricSpinButton &rEd, sal_uInt16 nValue)
static bool lcl_PutScaleItem3(TypedWhichId< SfxUInt16Item > nWhich, SfxItemSet &rCoreSet, const SfxItemSet &rOldSet, const weld::ComboBox &rListBox, sal_uInt16 nLBEntry, const weld::SpinButton &rEd, sal_uInt16 nValue)
IMPL_LINK(ScTablePage, PageNoHdl, weld::Toggleable &, rBtn, void)
static bool lcl_PutVObjModeItem(TypedWhichId< ScViewObjectModeItem > nWhich, SfxItemSet &rCoreSet, const SfxItemSet &rOldSet, const weld::Toggleable &rBtn)
static bool lcl_PutBoolItem(TypedWhichId< SfxBoolItem > nWhich, SfxItemSet &rCoreSet, const SfxItemSet &rOldSet, bool bIsChecked, bool bSavedValue)
constexpr OUStringLiteral PERCENT(u"Percent")