20#include <officecfg/Office/Writer.hxx>
74 return STR_ARR_METRIC[
nPos].second;
75 return FieldUnit::NONE;
79 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/optgeneralpage.ui",
"OptGeneralPage", &
rSet)
80 , m_pWrtShell(nullptr)
83 , m_xAlwaysRB(m_xBuilder->weld_radio_button(
"always"))
84 , m_xRequestRB(m_xBuilder->weld_radio_button(
"onrequest"))
85 , m_xNeverRB(m_xBuilder->weld_radio_button(
"never"))
86 , m_xAutoUpdateFields(m_xBuilder->weld_check_button(
"updatefields"))
87 , m_xAutoUpdateCharts(m_xBuilder->weld_check_button(
"updatecharts"))
88 , m_xMetricLB(m_xBuilder->weld_combo_box(
"metric"))
89 , m_xTabFT(m_xBuilder->weld_label(
"tablabel"))
90 , m_xTabMF(m_xBuilder->weld_metric_spin_button(
"tab",
FieldUnit::
CM))
91 , m_xUseSquaredPageMode(m_xBuilder->weld_check_button(
"squaremode"))
92 , m_xUseCharUnit(m_xBuilder->weld_check_button(
"usecharunit"))
93 , m_xWordCountED(m_xBuilder->weld_entry(
"wordcount"))
94 , m_xShowStandardizedPageCount(m_xBuilder->weld_check_button(
"standardizedpageshow"))
95 , m_xStandardizedPageSizeNF(m_xBuilder->weld_spin_button(
"standardpagesize"))
106 case FieldUnit::POINT:
107 case FieldUnit::PICA:
108 case FieldUnit::INCH:
111 m_xMetricLB->append(OUString::number(
static_cast<sal_uInt32
>(eFUnit)), sMetric);
142 return std::make_unique<SwLoadOptPage>(pPage, pController, *rAttrSet );
147 m_xStandardizedPageSizeNF->set_sensitive(m_xShowStandardizedPageCount->get_active());
157 nNewLinkMode =
NEVER;
191 const sal_uInt16 nFieldUnit =
m_xMetricLB->get_id(nMPos).toUInt32();
199 o3tl::narrowing<sal_uInt16>(
m_xTabMF->denormalize(
m_xTabMF->get_value(FieldUnit::TWIP)))));
205 if( (bIsUseCharUnitFlag ? 1 : 0) !=
m_xUseCharUnit->get_saved_state())
213 std::shared_ptr< comphelper::ConfigurationChanges > batch(
215 officecfg::Office::Writer::WordCount::AdditionalSeparators::set(
m_xWordCountED->get_text(), batch);
222 std::shared_ptr< comphelper::ConfigurationChanges > batch(
224 officecfg::Office::Writer::WordCount::ShowStandardizedPageCount::set(
233 std::shared_ptr< comphelper::ConfigurationChanges > batch(
235 officecfg::Office::Writer::WordCount::StandardizedPageSize::set(
296 for (sal_Int32
i = 0, nEntryCount =
m_xMetricLB->get_count();
i < nEntryCount; ++
i)
298 if (
m_xMetricLB->get_id(
i).toUInt32() ==
static_cast<sal_uInt32
>(eFieldUnit))
304 ::SetFieldUnit(*
m_xTabMF, eFieldUnit);
324 bool bUseCharUnit = pItem->GetValue();
334 m_xWordCountED->set_sensitive(!officecfg::Office::Writer::WordCount::AdditionalSeparators::isReadOnly());
347 const sal_Int32 nMPos = m_xMetricLB->get_active();
353 bool bModified = m_xTabMF->get_value_changed_from_saved();
355 sal::static_int_cast<sal_Int32, sal_Int64 >( m_xTabMF->denormalize( m_xTabMF->get_value( FieldUnit::TWIP ) )) :
357 ::SetFieldUnit( *m_xTabMF, eFieldUnit );
358 m_xTabMF->set_value( m_xTabMF->normalize( nVal ), FieldUnit::TWIP );
360 m_xTabMF->save_value();
372 : mbFontInitialized(false)
405 CustomWidgetController::SetDrawingArea(pDrawingArea);
420 rTest = m_aTextFilter.filter(rTest);
425 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/optcaptionpage.ui",
"OptCaptionPage", &
rSet)
426 , m_sSWTable(
SwResId(STR_CAPTION_TABLE))
427 , m_sSWFrame(
SwResId(STR_CAPTION_FRAME))
428 , m_sSWGraphic(
SwResId(STR_CAPTION_GRAPHIC))
429 , m_sOLE(
SwResId(STR_CAPTION_OLE))
430 , m_sBegin(
SwResId(STR_CAPTION_BEGINNING))
431 , m_sEnd(
SwResId(STR_CAPTION_END))
432 , m_sAbove(
SwResId(STR_CAPTION_ABOVE))
433 , m_sBelow(
SwResId(STR_CAPTION_BELOW))
434 , m_sNone(
SwResId(SW_STR_NONE))
435 , m_nPrevSelectedEntry(-1)
438 , m_aTextFilter(m_sNone)
439 , m_xCheckLB(m_xBuilder->weld_tree_view(
"objects"))
440 , m_xLbCaptionOrder(m_xBuilder->weld_combo_box(
"captionorder"))
441 , m_xSettingsGroup(m_xBuilder->weld_widget(
"settings"))
442 , m_xCategoryBox(m_xBuilder->weld_combo_box(
"category"))
443 , m_xFormatText(m_xBuilder->weld_label(
"numberingft"))
444 , m_xFormatBox(m_xBuilder->weld_combo_box(
"numbering"))
445 , m_xNumberingSeparatorFT(m_xBuilder->weld_label(
"numseparatorft"))
446 , m_xNumberingSeparatorED(m_xBuilder->weld_entry(
"numseparator"))
447 , m_xTextText(m_xBuilder->weld_label(
"separatorft"))
448 , m_xTextEdit(m_xBuilder->weld_entry(
"separator"))
449 , m_xPosBox(m_xBuilder->weld_combo_box(
"position"))
450 , m_xNumCapt(m_xBuilder->weld_widget(
"numcaption"))
451 , m_xLbLevel(m_xBuilder->weld_combo_box(
"level"))
452 , m_xEdDelim(m_xBuilder->weld_entry(
"chapseparator"))
453 ,
m_xCategory(m_xBuilder->weld_widget(
"categoryformat"))
454 , m_xCharStyleLB(m_xBuilder->weld_combo_box(
"charstyle"))
455 , m_xApplyBorderCB(m_xBuilder->weld_check_button(
"applyborder"))
456 , m_xPreview(new
weld::CustomWeld(*m_xBuilder,
"preview", m_aPreview))
474 for (
auto i =
m_pMgr->GetFieldTypeCount();
i; )
477 if (!pFieldType->
GetName().isEmpty()
480 nSelFormat = o3tl::narrowing<sal_uInt16>(
static_cast<SwSetExpFieldType*
>(pFieldType)->GetSeqFormat());
489 for ( sal_uInt16
i = 0;
i <
nCount; ++
i )
493 if (nFormatId == nSelFormat)
501 OUString sDelim(
": ");
541 return std::make_unique<SwCaptionOptPage>(pPage, pController, *rAttrSet);
595 const OUString sComplete(
596 sWithoutVersion +
" " +
610 sClass = aObjS[
i].GetHumanName();
612 sClass = sClass.replaceFirst( sComplete, sWithoutVersion );
619 SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst() ? 1 : 0);
647 delete weld::fromId<InsCaptionOpt*>(
m_xCheckLB->get_id(
i));
760 if (m_nPrevSelectedEntry != -1)
761 SaveEntry(m_nPrevSelectedEntry);
762 UpdateEntry(m_xCheckLB->get_selected_index());
763 m_nPrevSelectedEntry = m_xCheckLB->get_selected_index();
768 UpdateEntry(m_xCheckLB->get_iter_index_in_parent(rRowCol.first));
801 const OUString sFieldTypeName =
m_xCategoryBox->get_active_text();
804 pDlg->GetOKButton().set_sensitive(!sFieldTypeName.isEmpty());
839 int nSelEntry = m_xCheckLB->get_selected_index();
840 bool bChecked =
false;
843 bChecked = m_xCheckLB->get_toggle(nSelEntry) ==
TRISTATE_TRUE;
846 int nPos = rBox.get_active();
847 m_xNumberingSeparatorFT->set_sensitive(bChecked &&
nPos == 1);
848 m_xNumberingSeparatorED->set_sensitive(bChecked &&
nPos == 1);
860 const sal_uInt16 nNumFormat =
m_xFormatBox->get_active_id().toUInt32();
864 if( !bOrderNumberingFirst )
879 aNumVector.push_back(1);
881 const OUString sNumber( pSh->GetOutlineNumRule()->MakeNumString(
882 aNumVector,
false ));
883 if( !sNumber.isEmpty() )
897 default:
aStr +=
"1";
break;
901 if( bOrderNumberingFirst )
const StyleSettings & GetStyleSettings() const
sal_uInt16 GetValue() const
void SetCategory(const OUString &rCat)
const OUString & GetCategory() const
void SetNumType(const sal_uInt16 nNT)
void SetLevel(const sal_uInt16 nLvl)
const OUString & GetNumSeparator() const
sal_uInt16 GetPos() const
const OUString & GetCharacterStyle() const
sal_uInt16 GetNumType() const
void SetCaption(const OUString &rCap)
const OUString & GetCaption() const
void SetSeparator(const OUString &rSep)
void SetPos(const sal_uInt16 nP)
const OUString & GetSeparator() const
SwCapObjType GetObjType() const
void SetCharacterStyle(const OUString &rStyle)
sal_uInt16 GetLevel() const
void SetNumSeparator(const OUString &rSet)
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
void SetTextColor(const Color &rColor)
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
const AllSettings & GetSettings() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
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
void SetTabPage(std::unique_ptr< SfxTabPage > xTabPage)
weld::Container * get_content_area()
SfxOkDialogController * GetDialogController() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetWindowColor() const
const Color & GetWindowTextColor() const
void Remove(const SvGlobalName &)
SwCaptionOptDlg(weld::Window *pParent, const SfxItemSet &rSet)
std::unique_ptr< weld::Entry > m_xNumberingSeparatorED
std::unique_ptr< weld::ComboBox > m_xLbCaptionOrder
std::unique_ptr< weld::ComboBox > m_xCharStyleLB
std::unique_ptr< weld::Label > m_xNumberingSeparatorFT
std::unique_ptr< weld::Entry > m_xEdDelim
std::unique_ptr< weld::Widget > m_xCategory
std::unique_ptr< weld::ComboBox > m_xCategoryBox
std::unique_ptr< weld::Widget > m_xNumCapt
void UpdateEntry(int nRow)
void SaveEntry(int nEntry)
std::unique_ptr< SwFieldMgr > m_pMgr
std::unique_ptr< weld::Entry > m_xTextEdit
virtual void Reset(const SfxItemSet *rSet) override
SwCaptionPreview m_aPreview
std::unique_ptr< weld::CustomWeld > m_xPreview
std::unique_ptr< weld::ComboBox > m_xLbLevel
std::unique_ptr< weld::ComboBox > m_xPosBox
std::unique_ptr< weld::Widget > m_xSettingsGroup
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::TreeView > m_xCheckLB
std::unique_ptr< weld::Label > m_xFormatText
virtual ~SwCaptionOptPage() override
virtual bool FillItemSet(SfxItemSet *rSet) override
SwCaptionOptPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::ComboBox > m_xFormatBox
std::unique_ptr< weld::CheckButton > m_xApplyBorderCB
void SetOptions(const sal_uLong nPos, const SwCapObjType eType, const SvGlobalName *pOleId=nullptr)
std::unique_ptr< weld::Label > m_xTextText
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
void SetPreviewText(const OUString &rText)
void ApplySettings(vcl::RenderContext &rRenderContext)
bool IsSquaredPageMode() const
void SetDefaultPageMode(bool bSquaredPageMode)
void SetLinkUpdMode(sal_uInt16 nMode)
void SetFieldUpdateFlags(SwFieldUpdateFlags eFlags)
SwFieldUpdateFlags GetFieldUpdateFlags() const
sal_uInt16 GetLinkUpdMode() const
Embeds all local links (ranges/graphics).
Instances of SwFields and those derived from it occur 0 to n times.
virtual OUString GetName() const
Only in derived classes.
static sal_uInt32 Count()
static FieldUnit GetValue(sal_uInt32 i)
static OUString GetString(sal_uInt32 i)
std::unique_ptr< weld::ComboBox > m_xMetricLB
std::unique_ptr< weld::RadioButton > m_xNeverRB
virtual void Reset(const SfxItemSet *rSet) override
std::unique_ptr< weld::CheckButton > m_xShowStandardizedPageCount
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::CheckButton > m_xAutoUpdateFields
std::unique_ptr< weld::SpinButton > m_xStandardizedPageSizeNF
std::unique_ptr< weld::CheckButton > m_xAutoUpdateCharts
std::unique_ptr< weld::Entry > m_xWordCountED
std::unique_ptr< weld::Label > m_xTabFT
std::unique_ptr< weld::CheckButton > m_xUseCharUnit
std::unique_ptr< weld::MetricSpinButton > m_xTabMF
std::unique_ptr< weld::CheckButton > m_xUseSquaredPageMode
virtual ~SwLoadOptPage() override
std::unique_ptr< weld::RadioButton > m_xRequestRB
SwLoadOptPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< weld::RadioButton > m_xAlwaysRB
sal_Int32 GetUpdateLinkMode() const
SwFieldUpdateFlags GetFieldUpdateFlags() const
bool IsApplyCharUnit() const
void SetCaptionOrderNumberingFirst(bool bSet)
bool SetCapOption(bool bHTML, const InsCaptionOpt *pOpt)
const InsCaptionOpt * GetCapOption(bool bHTML, const SwCapObjType eType, const SvGlobalName *pOleId)
void SetInsWithCaption(bool bHTML, bool b)
void ApplyFieldUpdateFlags(SwFieldUpdateFlags eFieldFlags)
void ApplyDefaultPageMode(bool bIsSquaredPageMode)
void ApplyLinkMode(sal_Int32 nNewLinkMode)
const OUString & GetDelimiter() const
Number sequence fields chapterwise if required.
sal_uInt16 GetType() const
sal_uInt8 GetOutlineLvl() const
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
const SwView & GetView() const
const Color & GetColor() const
static std::shared_ptr< ConfigurationChanges > create()
std::unique_ptr< weld::ComboBox > m_xCategory
static OUString getProductVersion()
static OUString getProductName()
tools::Long GetFontHeight() const
void SetFontHeight(tools::Long nHeight)
virtual OutputDevice & get_ref_device()=0
std::pair< const TreeIter &, int > iter_col
#define FN_PARAM_WRTSHELL
@ AUTOUPD_FIELD_AND_CHARTS
#define LINK(Instance, Class, Member)
#define SAL_N_ELEMENTS(arr)
std::unique_ptr< sal_Int32[]> pData
bool IsAsianTypographyEnabled()
std::vector< tSwNumTreeNumber > tNumberVector
OString strip(const OString &rIn, char c)
constexpr OUStringLiteral first
const SwGetSetExpType GSE_SEQ
Sequence.
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
OUString toId(const void *pValue)
IMPL_LINK(SwCaptionOptPage, TextFilterHdl, OUString &, rTest, bool)
IMPL_LINK_NOARG(SwLoadOptPage, StandardizedPageCountCheckHdl, weld::Toggleable &, void)
@ RES_POOLCOLL_LABEL_DRAWING
Label drawing objects.
@ RES_POOLCOLL_LABEL_FRAME
Label frame.
@ RES_POOLCOLL_LABEL_TABLE
Label table.
@ RES_POOLCOLL_LABEL_ABB
Label illustration.
#define RESARRAY_INDEX_NOTFOUND
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_CHARS_LOWER_LETTER
SVX_NUM_CHARS_UPPER_LETTER
SVX_NUM_CHARS_UPPER_LETTER_N
SwWrtShell * GetActiveWrtShell()
OUString SwResId(TranslateId aId)
constexpr sal_uInt8 MAXLEVEL