21 #include <osl/thread.h>
47 #include <strings.hrc>
58 const char* pResId =
nullptr;
61 case RedlineType::Insert: pResId = STR_REDLINE_INSERT;
break;
62 case RedlineType::Delete: pResId = STR_REDLINE_DELETE;
break;
63 case RedlineType::Format: pResId = STR_REDLINE_FORMAT;
break;
64 case RedlineType::Table: pResId = STR_REDLINE_TABLE;
break;
65 case RedlineType::FmtColl: pResId = STR_REDLINE_FMTCOLL;
break;
66 case RedlineType::ParagraphFormat: pResId = STR_REDLINE_PARAGRAPH_FORMAT;
break;
67 case RedlineType::TableRowInsert: pResId = STR_REDLINE_TABLE_ROW_INSERT;
break;
68 case RedlineType::TableRowDelete: pResId = STR_REDLINE_TABLE_ROW_DELETE;
break;
69 case RedlineType::TableCellInsert: pResId = STR_REDLINE_TABLE_CELL_INSERT;
break;
70 case RedlineType::TableCellDelete: pResId = STR_REDLINE_TABLE_CELL_DELETE;
break;
82 if( bBalloon && !rRedl.
GetComment().isEmpty() )
85 return sBuf.makeStringAndClear();
90 OUString sDisplayText(rText);
94 if (nTextWidth > nMaxWidth)
95 sDisplayText =
GetEllipsisString(sDisplayText, nMaxWidth, DrawTextFlags::CenterEllipsis);
102 bool bQuickBalloon = bool(rEvt.
GetMode() & ( HelpEventMode::QUICK | HelpEventMode::BALLOON ));
105 bool bContinue =
true;
109 bool bBalloon = bool(rEvt.
GetMode() & HelpEventMode::BALLOON);
113 if( bQuickBalloon && pSdrView )
117 bContinue = pPage && pPage->
RequestHelp(
this, pSdrView, rEvt);
120 if( bContinue && bQuickBalloon)
141 case IsAttrAtPos::TableBoxFml:
147 sText = OStringToOUString(OString::number(
148 static_cast<const SwTableBoxValue*>(aContentAtPos.
aFnd.
pAttr)->GetValue()),
149 osl_getThreadTextEncoding());
153 sText = aContentAtPos.
sStr;
165 if( nFound != -1 && (++nFound) < sText.getLength() )
167 OUString
sSuffix( sText.copy(nFound) );
176 sText = sText.copy( 0, nFound - 1);
181 OUString sTmpSearchStr = sText.copy( 1 );
194 if( !sText.isEmpty() )
196 OUStringBuffer sTmp(sText.replaceAll(
u"\u00ad",
""));
197 for (sal_Int32
i = 0;
i < sTmp.getLength(); ++
i)
201 else if (sTmp[
i] == 0x2011)
204 sText = sTmp.makeStringAndClear();
211 if ( !bExecHyperlinks )
221 OUString aModStr( aModifiedCode.
GetName() );
222 aModStr = aModStr.replaceFirst(aCode.
GetName(),
"");
223 aModStr = aModStr.replaceAll(
"+",
"");
224 sText =
SwResId(STR_SMARTTAG_CLICK).replaceAll(
"%s", aModStr);
234 ? STR_ENDNOTE : STR_FTNNOTE ) + sTmp;
237 nStyle |= QuickHelpFlags::BiDiRtl;
245 if ( bShowTrackChanges && bShowInlineTooltips )
251 sText = aContentAtPos.
sStr;
255 GetTOXMark().GetTOXType();
258 sText =
": " + sText;
267 sText =
SwResId(STR_CONTENT_TYPE_SINGLE_REFERENCE) +
": ";
278 switch( pField->
Which() )
284 sal_uInt16 nOldSubType = pField->
GetSubType();
287 const_cast<SwField*
>(pField)->SetSubType(nOldSubType);
316 sText =
static_cast<const SwMacroField*
>(pField)->GetMacro();
322 const SwGetRefField* pRefField( dynamic_cast<const SwGetRefField*>(pField) );
323 OSL_ENSURE( pRefField,
324 "<SwEditWin::RequestHelp(..)> - unexpected type of <pField>" );
331 if ( sText.getLength() > 80 )
333 sText = OUString::Concat(sText.subView(0, 80)) +
"...";
338 sText =
static_cast<const SwGetRefField*
>(pField)->GetSetRefName();
348 if( sText.isEmpty() )
352 if ( bShowTrackChanges && bShowInlineTooltips )
361 if (!sText.isEmpty())
365 aRect.SetLeft( aPt.X() );
366 aRect.SetTop( aPt.Y() );
368 aRect.SetRight( aPt.X() );
369 aRect.SetBottom( aPt.Y() );
373 aRect.AdjustLeft(-1);
374 aRect.AdjustRight(1);
376 aRect.AdjustBottom(1);
394 Window::RequestHelp( rEvt );
412 bool bPaintShadowCursor =
false;
422 else if( rRect.
IsOver( aRect ))
427 bPaintShadowCursor =
true;
437 bool bTiledPainting =
false;
443 pWrtShell->
Paint(rRenderContext, rRect);
451 if( bPaintShadowCursor )
void setOutputToWindow(bool bOutputToWindow)
OUString GetExpandedTextOfReferencedTextNode(SwRootFrame const &rLayout) const
constexpr sal_uInt16 KEY_MOD1
OUString ClipLongToolTip(const OUString &rText)
fdo#55546 cut very long tooltips to 2/3 of the width of the screen via center ellipsis ...
OUString const & GetAuthorString(sal_uInt16 nPos=0) const
bool IsShowContentTips() const
const SwView & GetView() const
bool IsHideFieldTips() const
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
const SfxPoolItem * pAttr
Base class of all fields.
Provides access to the marks of a document.
void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
SVL_DLLPUBLIC OUString removePassword(OUString const &rURI, INetURLObject::EncodeMechanism eEncodeMechanism, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
tools::Rectangle GetDesktopRectPixel() const
Of course Writer needs its own rectangles.
constexpr sal_uInt16 KEY_SPACE
void setTiledPainting(bool bTiledPainting)
For old documents the Field-Which IDs must be preserved !!!
HelpEventMode GetMode() const
static bool IsShowChanges(const RedlineFlags eM)
virtual void RequestHelp(const HelpEvent &rEvt) override
SwWrtShell & GetWrtShell() const
Used by the UI to modify the document model.
virtual OUString GetPar1() const
SwFrameControlsManager & GetFrameControlsManager()
const DateTime & GetTimeStamp(sal_uInt16 nPos=0) const
OUString GetEllipsisString(const OUString &rStr, tools::Long nMaxWidth, DrawTextFlags nStyle=DrawTextFlags::EndEllipsis) const
virtual void PrePaint(vcl::RenderContext &rRenderContext) override
IsAttrAtPos eContentAtPos
union SwContentAtPos::@24 aFnd
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
const Point & GetMousePosPixel() const
bool IsShowOutlineContentVisibilityButton() const
SwDoc * GetDoc()
returns Doc. But be careful!
virtual const_iterator_t getBookmarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of IBookmarks.
void SetOutlineContentVisibilityButtons()
bool IsRefToNumItemCrossRefBookmark() const
OUString GetExpandTextMerged(SwRootFrame const *const pLayout, SwTextNode const &rNode, bool const bWithNumber, bool const bWithSpacesForLevel, ExpandMode const i_mode)
const SwExtendedSubType SUB_CMD
Show command.
std::unique_ptr< SwShadowCursor, o3tl::default_delete< SwShadowCursor > > m_pShadCursor
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
const OUString & GetTypeName() const
OUString GetName(vcl::Window *pWindow=nullptr) const
virtual const_iterator_t findBookmark(const OUString &rMark) const =0
Finds a bookmark by name.
OUString SwResId(const char *pId)
virtual OUString GetPar2() const
const sal_Unicode cMarkSeparator
const SwTextAttr * pFndTextAttr
Point ScreenToOutputPixel(const Point &rPos) const
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
virtual sal_uInt16 GetSubType() const
SwDocShell * GetDocShell()
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
const OUString & GetComment(sal_uInt16 nPos=0) const
bool RequestHelp(vcl::Window *pWindow, SdrView const *pView, const HelpEvent &rEvt)
SwTextNode is a paragraph in the document model.
ExpandMode
Some helpers for converting model strings to view strings.
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
SwWrtShell * GetWrtShellPtr() const
SwFieldIds Which() const
ResId.
tools::Rectangle SVRect() const
bool IsShowInlineTooltips() const
bool IsRefToHeadingCrossRefBookmark() const
SdrPage * GetPage() const
const SwViewOption * GetViewOptions() const
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
RedlineType GetType(sal_uInt16 nPos=0) const
virtual OUString GetFieldName() const
get name or content
const SwRangeRedline * pRedl
const tools::Rectangle & GetVisArea() const
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
Point OutputToScreenPixel(const Point &rPos) const
bool GetContentAtPos(const Point &rPt, SwContentAtPos &rContentAtPos, bool bSetCursor=false, SwRect *pFieldRect=nullptr)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
static OUString GetURLHelpText(std::u16string_view)
SwRootFrame * GetLayout() const
static OUString lcl_GetRedlineHelp(const SwRangeRedline &rRedl, bool bBalloon)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)