20 #include <config_features.h>
21 #include <config_fuzzers.h>
41 #include <com/sun/star/beans/XPropertySet.hpp>
42 #include <com/sun/star/document/XDocumentProperties.hpp>
43 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
44 #include <com/sun/star/frame/XModel.hpp>
60 SwSetExpField *
const pSetField(dynamic_cast<SwSetExpField*>(pCurField));
68 assert(!
"what input field is this");
87 bool bSelectionFailed = pCurField != pRealCurField;
102 "modules/swriter/ui/editfielddialog.ui",
"EditFieldDialog")
103 , pSh(rVw.GetWrtShellPtr())
104 , m_xPrevBT(m_xBuilder->weld_button(
"prev"))
105 , m_xNextBT(m_xBuilder->weld_button(
"next"))
106 , m_xAddressBT(m_xBuilder->weld_button(
"edit"))
150 bool bMove = rMgr.
GoNext();
176 std::unique_ptr<SfxTabPage> xTabPage;
194 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
195 pDocSh->
GetModel(), uno::UNO_QUERY_THROW);
196 uno::Reference<document::XDocumentProperties> xDocProps
197 = xDPS->getDocumentProperties();
198 uno::Reference< beans::XPropertySet > xUDProps(
199 xDocProps->getUserDefinedProperties(),
200 uno::UNO_QUERY_THROW);
205 #if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
246 if (GetOKButton().get_sensitive())
264 bool bNext = &rButton == m_xNextBT.get();
273 if (GetOKButton().get_sensitive())
279 pOldTyp = pCurField->
GetTyp();
287 pTabPage = static_cast<SwFieldPage*>(
CreatePage(nGroup));
292 EnsureSelection(pCurField, rMgr);
307 case EU_FIRSTNAME: nEditPos = EditPosition::FIRSTNAME;
break;
308 case EU_NAME: nEditPos = EditPosition::LASTNAME;
break;
309 case EU_SHORTCUT: nEditPos = EditPosition::SHORTNAME;
break;
310 case EU_COMPANY: nEditPos = EditPosition::COMPANY;
break;
311 case EU_STREET: nEditPos = EditPosition::STREET;
break;
312 case EU_TITLE: nEditPos = EditPosition::TITLE;
break;
313 case EU_POSITION: nEditPos = EditPosition::POSITION;
break;
316 case EU_FAX: nEditPos = EditPosition::FAX;
break;
317 case EU_EMAIL: nEditPos = EditPosition::EMAIL;
break;
318 case EU_COUNTRY: nEditPos = EditPosition::COUNTRY;
break;
319 case EU_ZIP: nEditPos = EditPosition::PLZ;
break;
320 case EU_CITY: nEditPos = EditPosition::CITY;
break;
321 case EU_STATE: nEditPos = EditPosition::STATE;
break;
323 default: nEditPos = EditPosition::UNKNOWN;
break;
326 aSet.
Put(
SfxUInt16Item(SID_FIELD_GRABFOCUS, static_cast<sal_uInt16>(nEditPos)));
330 if (
RET_OK == pDlg->Execute())
332 pSh->UpdateOneField(*pCurField);
#define LINK(Instance, Class, Member)
Instances of SwFields and those derived from it occur 0 to n times.
bool Right(sal_uInt16 nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
Marks a position in the document model.
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
SwShellCursor * getShellCursor(bool bBlock)
Delivers the current shell cursor.
Base class of all fields.
css::uno::Reference< css::frame::XModel3 > GetModel() const
std::unique_ptr< IconChoicePage >(* CreatePage)(weld::Container *pParent, SvxHpLinkDlg *pDlg, const SfxItemSet *pAttrSet)
weld::Container * get_content_area()
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
static SfxObjectShell * Current()
virtual sal_uInt16 GetGroup()=0
void EnableInsert(bool bEnable)
virtual bool FillItemSet(SfxItemSet *)
SwFieldMgr & GetFieldMgr()
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
void NormalizePam(bool bPointFirst=true)
Ensure point and mark of the current PaM are in a specific order.
IMPL_LINK(SwFieldEditDlg, NextPrevHdl, weld::Button &, rButton, void)
SfxItemPool & GetPool() const
std::unique_ptr< weld::Button > m_xAddressBT
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
bool HasSelection() const
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
virtual ~SwFieldEditDlg() override
const SwPosition * GetPoint() const
SwAbstractDialogFactory & GetFactory()
IMPL_LINK_NOARG(SwFieldEditDlg, OKHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xNextBT
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
virtual VclPtr< SfxAbstractDialog > CreateSwAddressAbstractDlg(weld::Window *pParent, const SfxItemSet &rSet)=0
void SetTabPage(std::unique_ptr< SfxTabPage > xTabPage)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
SwFieldEditDlg(SwView const &rVw)
bool HasReadonlySel() const
bool GoNextPrev(bool bNext=true, SwFieldType *pTyp=nullptr)
virtual sal_uInt16 GetSubType() const
SwFieldType * GetTyp() const
void EnsureSelection(SwField *pCurField, SwFieldMgr &rMgr)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void EditNewField(bool bOnlyActivate=false)
SwFieldTypesEnum GetTypeId() const
SwFormatField * GetFormatField()
bool IsReadOnlyAvailable() const
bool GotoField(const SwFormatField &rField)
SfxTabPage * CreatePage(sal_uInt16 nGroup)
std::unique_ptr< weld::Button > m_xPrevBT
static void SetCareDialog(const std::shared_ptr< weld::Window > &rNew)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
static sal_uInt16 GetGroup(SwFieldTypesEnum nTypeId, sal_uInt16 nSubType)
Reference< XExecutableDialog > m_xDialog
virtual short run() override
const sal_uInt16 CRSR_SKIP_CHARS
SfxTabPage * GetTabPage() const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
virtual weld::Button & GetOKButton() const override
void EndAction(const bool bIdleEnd=false)
#define FN_FIELD_DIALOG_DOC_PROPS
bool CursorInsideInputField() const