21#include <osl/diagnose.h>
22#include <osl/thread.h>
62 case RedlineType::Insert: pResId = bTableChange
63 ? STR_REDLINE_TABLE_ROW_INSERT
65 ? STR_REDLINE_INSERT_MOVED
68 case RedlineType::Delete: pResId = bTableChange
69 ? STR_REDLINE_TABLE_ROW_DELETE
71 ? STR_REDLINE_DELETE_MOVED
74 case RedlineType::Format: pResId = STR_REDLINE_FORMAT;
break;
75 case RedlineType::Table: pResId = STR_REDLINE_TABLE;
break;
76 case RedlineType::FmtColl: pResId = STR_REDLINE_FMTCOLL;
break;
77 case RedlineType::ParagraphFormat: pResId = STR_REDLINE_PARAGRAPH_FORMAT;
break;
78 case RedlineType::TableRowInsert: pResId = STR_REDLINE_TABLE_ROW_INSERT;
break;
79 case RedlineType::TableRowDelete: pResId = STR_REDLINE_TABLE_ROW_DELETE;
break;
80 case RedlineType::TableCellInsert: pResId = STR_REDLINE_TABLE_CELL_INSERT;
break;
81 case RedlineType::TableCellDelete: pResId = STR_REDLINE_TABLE_CELL_DELETE;
break;
93 if( bBalloon && !rRedl.
GetComment().isEmpty() )
96 return sBuf.makeStringAndClear();
101 OUString sDisplayText(rText);
105 if (nTextWidth > nMaxWidth)
113 bool bQuickBalloon = bool(rEvt.
GetMode() & ( HelpEventMode::QUICK | HelpEventMode::BALLOON ));
116 bool bContinue =
true;
120 bool bBalloon = bool(rEvt.
GetMode() & HelpEventMode::BALLOON);
124 if( bQuickBalloon && pSdrView )
128 bContinue = pPage && pPage->
RequestHelp(
this, pSdrView, rEvt);
131 if( bContinue && bQuickBalloon)
161 sText = OUString::number(
167 sText = aContentAtPos.
sStr;
179 if( nFound != -1 && (++nFound) < sText.getLength() )
181 std::u16string_view
sSuffix( sText.subView(nFound) );
190 sText = sText.copy( 0, nFound - 1);
195 OUString sTmpSearchStr = sText.copy( 1 );
208 if( !sText.isEmpty() )
210 OUStringBuffer sTmp(sText.replaceAll(
u"\u00ad",
""));
211 for (sal_Int32
i = 0;
i < sTmp.getLength(); ++
i)
215 else if (sTmp[
i] == 0x2011)
218 sText = sTmp.makeStringAndClear();
225 if ( !bExecHyperlinks )
235 OUString aModStr( aModifiedCode.
GetName() );
236 aModStr = aModStr.replaceFirst(aCode.
GetName(),
"");
237 aModStr = aModStr.replaceAll(
"+",
"");
238 sText =
SwResId(STR_SMARTTAG_CLICK).replaceAll(
"%s", aModStr);
248 ? STR_ENDNOTE : STR_FTNNOTE ) + sTmp;
251 nStyle |= QuickHelpFlags::BiDiRtl;
260 if ( bShowTrackChanges && bShowInlineTooltips )
268 sText = aContentAtPos.
sStr;
272 GetTOXMark().GetTOXType();
275 sText =
": " + sText;
284 sText =
SwResId(STR_CONTENT_TYPE_SINGLE_REFERENCE) +
": ";
295 switch( pField->
Which() )
301 sal_uInt16 nOldSubType = pField->
GetSubType();
304 const_cast<SwField*
>(pField)->SetSubType(nOldSubType);
326 OUString aTitle = pField->
GetTitle();
327 if (!aTitle.isEmpty())
345 sText =
static_cast<const SwMacroField*
>(pField)->GetMacro();
352 OSL_ENSURE( pRefField,
353 "<SwEditWin::RequestHelp(..)> - unexpected type of <pField>" );
360 if ( sText.getLength() > 80 )
362 sText = OUString::Concat(sText.subView(0, 80)) +
"...";
377 if (!pAuthorityField->UseTargetURL() && pAuthorityField->HasURL())
379 const OUString& rURL = pAuthorityField->GetAbsoluteURL();
382 else if (pAuthorityField->UseTargetURL() && pAuthorityField->HasTargetURL())
384 const OUString& rURL = pAuthorityField->GetAbsoluteTargetURL();
395 if( sText.isEmpty() )
399 if ( bShowTrackChanges && bShowInlineTooltips )
408 if (!sText.isEmpty())
441 Window::RequestHelp( rEvt );
447 pWrtShell->PrePaint();
455 bool bPaintShadowCursor =
false;
470 bPaintShadowCursor =
true;
474 if (
GetView().GetVisArea().GetWidth() <= 0 ||
475 GetView().GetVisArea().GetHeight() <= 0 )
480 bool bTiledPainting =
false;
486 pWrtShell->
Paint(rRenderContext, rRect);
494 if( bPaintShadowCursor )
HelpEventMode GetMode() const
const Point & GetMousePosPixel() const
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
Provides access to the marks of a document.
virtual const_iterator_t findBookmark(const OUString &rMark) const =0
Finds a bookmark by name.
@ CROSSREF_HEADING_BOOKMARK
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
virtual const_iterator_t getBookmarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of IBookmarks.
static bool IsShowChanges(const RedlineFlags eM)
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
OUString GetEllipsisString(const OUString &rStr, tools::Long nMaxWidth, DrawTextFlags nStyle=DrawTextFlags::EndEllipsis) const
SdrPage * GetPage() const
SdrPageView * GetSdrPageView() const
static OUString GetURLHelpText(std::u16string_view)
Represents an inserted bibliography entry, created using Insert -> Table of Contents and Index -> Bib...
OUString GetAuthority(const SwRootFrame *pLayout, const SwForm *pTOX=nullptr) const
Returns the line matching the source's default row in the ToX.
void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
bool GetContentAtPos(const Point &rPt, SwContentAtPos &rContentAtPos, bool bSetCursor=false, SwRect *pFieldRect=nullptr)
SwDPage is Writer's draw page: derives from SdrPage, but has a reference to the Writer document via S...
bool RequestHelp(vcl::Window *pWindow, SdrView const *pView, const HelpEvent &rEvt)
SwDoc * GetDoc()
returns Doc. But be careful!
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
virtual void PrePaint(vcl::RenderContext &rRenderContext) override
OUString ClipLongToolTip(const OUString &rText)
fdo#55546 cut very long tooltips to 2/3 of the width of the screen via center ellipsis
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
const SwView & GetView() const
virtual void RequestHelp(const HelpEvent &rEvt) override
std::unique_ptr< SwShadowCursor, o3tl::default_delete< SwShadowCursor > > m_pShadCursor
Base class of all fields.
virtual OUString GetPar1() const
virtual sal_uInt16 GetSubType() const
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
virtual OUString GetFieldName() const
get name or content
SwFieldIds Which() const
ResId.
virtual OUString GetPar2() const
const OUString & GetTitle() const
bool IsRefToNumItemCrossRefBookmark() const
bool IsRefToHeadingCrossRefBookmark() const
OUString GetExpandedTextOfReferencedTextNode(SwRootFrame const &rLayout) const
const OUString & GetSetRefName() const
bool IsHideFieldTips() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
const OUString & GetComment(sal_uInt16 nPos=0) const
OUString const & GetAuthorString(sal_uInt16 nPos=0) const
const DateTime & GetTimeStamp(sal_uInt16 nPos=0) const
RedlineType GetType(sal_uInt16 nPos=0) const
Of course Writer needs its own rectangles.
tools::Rectangle SVRect() const
const OUString & GetTypeName() const
SwTextNode is a paragraph in the document model.
bool IsShowContentTips() const
bool IsShowInlineTooltips() const
const SwViewOption * GetViewOptions() const
void setOutputToWindow(bool bOutputToWindow)
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
SwRootFrame * GetLayout() const
SwWrtShell & GetWrtShell() const
SwWrtShell * GetWrtShellPtr() const
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
Point OutputToScreenPixel(const Point &rPos) const
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Point LogicToPixel(const Point &rLogicPt) const
tools::Rectangle GetDesktopRectPixel() const
::OutputDevice const * GetOutDev() const
Point PixelToLogic(const Point &rDevicePt) const
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Point ScreenToOutputPixel(const Point &rPos) const
@ CurrAttrs
only for debugging
@ TableBoxValue
only for debugging
static OUString lcl_GetRedlineHelp(const SwRangeRedline &rRedl, bool bBalloon, bool bTableChange)
@ Database
For old documents the Field-Which IDs must be preserved !!!
constexpr sal_uInt16 KEY_MOD1
constexpr sal_uInt16 KEY_SPACE
ExpandMode
Some helpers for converting model strings to view strings.
SVL_DLLPUBLIC OUString removePassword(OUString const &rURI, INetURLObject::EncodeMechanism eEncodeMechanism, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
void setTiledPainting(bool bTiledPainting)
const SwExtendedSubType SUB_CMD
Show command.
OUString GetExpandTextMerged(SwRootFrame const *const pLayout, SwTextNode const &rNode, bool const bWithNumber, bool const bWithSpacesForLevel, ExpandMode const i_mode)
const SwRangeRedline * pRedl
union SwContentAtPos::@24 aFnd
const SfxPoolItem * pAttr
const SwTextAttr * pFndTextAttr
IsAttrAtPos eContentAtPos
OUString SwResId(TranslateId aId)
const sal_Unicode cMarkSeparator