33 #include <osl/diagnose.h>
55 #include <strings.hrc>
60 #define ENV_NEWDOC RET_OK
61 #define ENV_INSERT RET_USER
67 OUString aText = rText.replaceAll(
"\r",
"");
69 sal_Int32 nTokenPos = 0;
70 while( -1 != nTokenPos )
72 OUString aLine = aText.getToken( 0,
'\n', nTokenPos );
73 while ( !aLine.isEmpty() )
78 sal_Int32
nPos = aLine.indexOf(
'<' );
81 sal_Int32
const nCopy((nPos != -1) ? nPos : aLine.getLength());
82 sTmpText = aLine.copy(0, nCopy);
83 aLine = aLine.copy(nCopy);
87 nPos = aLine.indexOf(
'>' );
95 sTmpText = aLine.copy( 0, nPos + 1);
96 aLine = aLine.copy( nPos + 1);
99 OUString sDBName( sTmpText.copy( 1, sTmpText.getLength() - 2));
123 for( sal_uInt16 nCnt = 0; nCnt < nCollCnt; ++nCnt )
133 static sal_uInt16 nTitleNo = 0;
143 pOldSh = pMyDocSh ? pMyDocSh->
GetWrtShell() :
nullptr;
150 pNewView->AttrChangedNotify(
nullptr);
153 OUString aTmp =
SwResId(STR_ENV_TITLE) + OUString::number( ++nTitleNo );
168 bool bEnvChange =
false;
179 bEnvChange = rCurPageDesc.
GetName() == sEnvelope;
201 nMode = pDlg->Execute();
206 if ( pBoolItem && pBoolItem->
GetValue() )
212 SwWait aWait( static_cast<SwDocShell&>(*xDocSh),
true );
225 OSL_ENSURE(pOldSh,
"No document - wasn't 'Insert' disabled???");
235 const OUString sSendMark = pSend->
GetName();
236 const OUString sAddrMark = pAddr->GetName();
291 OUString sFollowName(pFollow->
GetName());
316 std::vector<SwFrameFormat*> aFlyArr;
337 sal_uInt16 nPageW = o3tl::narrowing<sal_uInt16>(std::max(rItem.
m_nWidth, rItem.
m_nHeight)),
355 aLRMargin.
SetLeft (o3tl::narrowing<sal_uInt16>(lLeft) );
356 aULMargin.
SetUpper(o3tl::narrowing<sal_uInt16>(lUpper));
373 nPageW + lLeft, nPageH + lUpper));
439 if (!aFlyArr.empty())
458 static sal_uInt16
const aInva[] =
void GetPageObjs(std::vector< SwFrameFormat * > &rFillArr)
SS for envelopes: get all page-bound objects and set them to new page.
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
void SetFlyName(const OUString &rName)
Set name at selected FlyFrame.
bool Right(sal_uInt16 nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
void SetUseOn(UseOnPage eNew)
Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is not modified.
void SplitNode(bool bAutoFormat=false)
bool EndPg(bool bSelect=false)
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
Represents the style of a paragraph.
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
void ChgHeaderShare(bool bNew)
bool SttEndDoc(bool bStt)
virtual const SfxItemSet * GetOutputItemSet() const =0
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
sal_uInt16 GetTextFormatCollCount() const
bool SttNxtPg(bool bSelect=false)
constexpr TypedWhichId< SvxPaperBinItem > RES_PAPER_BIN(90)
sal_Int32 m_nAddrFromLeft
static void lcl_CopyCollAttr(SwWrtShell const *pOldSh, SwWrtShell *pNewSh, sal_uInt16 nCollId)
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
void Done(bool bRemove=false)
void DoUndo(bool bOn=true)
Undo.
static SfxObjectShell * Current()
void Invalidate(sal_uInt16 nId)
sal_Int32 m_nSendFromLeft
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
bool InsertField(const SwInsertField_Data &rData)
void SetFollow(const SwPageDesc *pNew)
const OUString & GetName() const
Used by the UI to modify the document model.
OUString SwResId(TranslateId aId)
constexpr tools::Long Width() const
SwTextFormatColl & GetTextFormatColl(sal_uInt16 nTextFormatColl) const
void disposeAndReset(reference_type *pBody)
bool GotoFly(const OUString &rName, FlyCntType eType=FLYCNTTYPE_ALL, bool bSelFrame=true)
constexpr auto SFX_INTERFACE_NONE
OUString ReplacePoint(const OUString &rTmpName, bool bWithCommandType)
const SwView & GetView() const
void SetPageObjsNewPage(std::vector< SwFrameFormat * > &rFillArr)
void InsertEnv(SfxRequest &)
void SetLandscape(bool bNew)
SfxFrame & GetFrame() const
const SfxItemSet & GetAttrSet() const
const Size & GetPaperSizePixel() const
void Insert(const OUString &)
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
SfxItemPool & GetPool() const
constexpr OUStringLiteral aData
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
void SetHeightSizeType(SwFrameSize eType)
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
const SfxItemPool & GetAttrPool() const
const SwTableNode * IsCursorInTable() const
void SetTextFormatColl(SwTextFormatColl *, const bool bResetListAttrs=false)
Add 2nd optional parameter - see also
void SetNumType(const SvxNumberType &rNew)
void ChgFooterShare(bool bNew)
SfxBindings & GetBindings()
void SetTitle(const OUString &rTitle)
const SwPageDesc & GetPageDesc(size_t i) const
const T * GetArg(sal_uInt16 nSlotId) const
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
SwDBData const & GetDBData() const
Database information.
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
static SwAbstractDialogFactory * Create()
virtual void setJobsetup(const JobSetup &rJobSetup)=0
Sets the Jobsetup.
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
SfxViewShell * GetViewShell() const
Frame cannot be moved in Var-direction.
virtual const JobSetup * getJobsetup() const =0
Returns the Jobsetup.
OUString InsertLabEnvText(SwWrtShell &rSh, SwFieldMgr &rFieldMgr, const OUString &rText)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
Provides access to the formatting devices of a document.
SwFrameFormat & GetMaster()
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwWrtShell * GetWrtShellPtr() const
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
static SfxViewFrame * LoadHiddenDocument(SfxObjectShell const &i_rDoc, SfxInterfaceId i_nViewId)
void SetTableAttr(const SfxItemSet &)
virtual VclPtr< SfxAbstractTabDialog > CreateSwEnvDlg(weld::Window *pParent, const SfxItemSet &rSet, SwWrtShell *pWrtSh, Printer *pPrt, bool bInsert)=0
void SetULSpace(tools::Long nTop, tools::Long nBottom)
void ChgPageDesc(size_t i, const SwPageDesc &)
SwPageDesc * GetPageDescFromPool(sal_uInt16 nId)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
void SetNewDoc()
Optimizing UI.
void SetView(SwView *pVw)
SwPageDesc * FindPageDescByName(const OUString &rName, bool bGetFromPool=false, size_t *pPos=nullptr)
const sal_uInt16 CRSR_SKIP_CHARS
void AppendItem(const SfxPoolItem &)
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::std::optional< sal_uInt16 > &rPgNum=std::nullopt)
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
void SetNumberingType(SvxNumType nSet)
Frame is variable in Var-direction.
void ChgCurPageDesc(const SwPageDesc &)
PageDescriptor-interface.
void StartAllAction()
For all views of this document.
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
size_t GetCurPageDesc(const bool bCalcFrame=true) const
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
void SetLRSpace(tools::Long nLeft, tools::Long nRight)