21#include <boost/property_tree/json_parser.hpp>
35#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
39#include <editeng/editeng.hxx>
54#include <drawview.hxx>
56#include <SpellDialogChildWindow.hxx>
58#include <svx/svxids.hrc>
59#include <LibreOfficeKit/LibreOfficeKitEnums.h>
96 const std::shared_ptr<sd::ViewShell>& rpViewShell,
138 mpDrawDocument(pDoc),
140 mnIgnoreCurrentPageChangesLevel(0),
141 mbStringFound(false),
142 mbMatchMayExist(false),
144 mbEndOfSearch(false),
145 mbFoundObject(false),
146 mbDirectionIsForward(true),
147 mbRestrictSearchToSelection(false),
150 mpSearchSpellTextObj(nullptr),
155 mnStartPageIndex(sal_uInt16(-1)),
156 mpStartEditedObject(nullptr),
157 mbPrepareSpellingPending(true)
165 nCntrl |= EEControlBits::ALLOWBIGOBJS;
166 nCntrl |= EEControlBits::MARKFIELDS;
167 nCntrl |= EEControlBits::AUTOCORRECT;
169 bool bOnlineSpell =
false;
179 bOnlineSpell =
false;
185 aAny >>= bOnlineSpell;
189 OSL_FAIL(
"Ill. type in linguistic property" );
194 nCntrl |= EEControlBits::ONLINESPELLING;
198 SetControlWord(nCntrl);
201 if ( xSpellChecker.is() )
202 SetSpeller( xSpellChecker );
205 if( xHyphenator.is() )
206 SetHyphenator( xHyphenator );
218 return mpImpl->GetOutlinerView();
246 if (pBase !=
nullptr)
248 SetRefDevice(
SD_MOD()->GetVirtualRefDevice() );
285 std::shared_ptr<sd::ViewShell> pOldViewShell (pViewShell);
288 if (pBase !=
nullptr)
296 bool bViewIsDrawViewShell(
dynamic_cast< const sd::DrawViewShell *
>( pViewShell.get() ));
297 if (bViewIsDrawViewShell)
300 mpView = pViewShell->GetView();
304 pViewShell->GetDispatcher()->Execute(
306 SfxCallMode::SYNCHRON | SfxCallMode::RECORD);
311 if (pOutlinerView !=
nullptr)
313 RemoveView(pOutlinerView);
314 mpImpl->ReleaseOutlinerView();
317 SetUpdateLayout(
true);
325 pOutlineView->PrepareClose();
357 pOutlineView->PrepareClose();
362 mpWindow = pViewShell->GetActiveWindow();
364 if (pOutlinerView !=
nullptr)
390 bool bFoundNextSentence =
false;
391 while ( ! bFoundNextSentence)
394 if (pOutlinerView !=
nullptr)
402 bFoundNextSentence = SpellSentence( pOutlinerView->
GetEditView(), aResult);
408 if ( ! bFoundNextSentence)
422 bool bEndOfSearch =
true;
432 && pSearchItem->
GetCommand() == SvxSearchCmd::REPLACE
446 if (pBase !=
nullptr)
450 if (pShell ==
nullptr)
453 switch (pShell->GetShellType())
471 OSL_ASSERT(pViewShell);
485 if (nCommand == SvxSearchCmd::FIND_ALL || nCommand == SvxSearchCmd::REPLACE_ALL)
498 if (nCommand == SvxSearchCmd::FIND)
499 bEndOfSearch =
false;
525 OSL_ASSERT(pViewShell);
591 OSL_ASSERT(pViewShell);
595 std::vector<sd::SearchSelection> aSelections;
604 else if(
nullptr !=
dynamic_cast< const sd::DrawViewShell *
>( pViewShell.get() ))
607 SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
647 boost::property_tree::ptree aTree;
648 aTree.put(
"searchString",
mpSearchItem->GetSearchString().toUtf8().getStr());
649 aTree.put(
"highlightAll",
true);
651 boost::property_tree::ptree aChildren;
654 boost::property_tree::ptree aChild;
655 aChild.put(
"part", OString::number(rSelection.m_nPage).getStr());
656 aChild.put(
"rectangles", rSelection.m_aRectangles.getStr());
657 aChildren.push_back(std::make_pair(
"", aChild));
659 aTree.add_child(
"searchResultSelection", aChildren);
661 std::stringstream aStream;
662 boost::property_tree::write_json(aStream, aTree);
663 OString aPayload( aStream.str() );
674 SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
681 std::vector<OString> aRectangles;
685 aRectangles.push_back(rSelection.m_aRectangles);
699basegfx::B2DRectangle getPDFSelection(
const std::unique_ptr<VectorGraphicSearch> & rVectorGraphicSearch,
704 auto const & rTextRectangles = rVectorGraphicSearch->getTextRectangles();
705 if (rTextRectangles.empty())
716 aB2DMatrix.
scale(aObjectB2DRectHMM.getWidth() / aPdfPageSizeHMM.
getWidth(),
717 aObjectB2DRectHMM.getHeight() / aPdfPageSizeHMM.
getHeight());
719 aB2DMatrix.
translate(aObjectB2DRectHMM.getMinX(), aObjectB2DRectHMM.getMinY());
722 for (
auto const & rRectangle : rVectorGraphicSearch->getTextRectangles())
725 aRectangle *= aB2DMatrix;
728 aSelection = aRectangle;
730 aSelection.
expand(aRectangle);
740 std::vector<sd::SearchSelection>* pSelections)
742 std::vector<::tools::Rectangle> aLogicRects;
743 auto& rVectorGraphicSearchContext =
mpImpl->getVectorGraphicSearchContext();
744 if (rVectorGraphicSearchContext.mbCurrentIsVectorGraphic)
751 aLogicRects.push_back(aSelection);
769 std::vector<OString> aLogicRectStrings;
770 std::transform(aLogicRects.begin(), aLogicRects.end(), std::back_inserter(aLogicRectStrings),
771 [](const ::tools::Rectangle& rRectangle)
773 return rRectangle.toString();
782 SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
786 boost::property_tree::ptree aTree;
787 aTree.put(
"searchString",
mpSearchItem->GetSearchString().toUtf8().getStr());
788 aTree.put(
"highlightAll",
false);
790 boost::property_tree::ptree aChildren;
791 boost::property_tree::ptree aChild;
793 aChild.put(
"rectangles", sRectangles.getStr());
794 aChildren.push_back(std::make_pair(
"", aChild));
795 aTree.add_child(
"searchResultSelection", aChildren);
797 std::stringstream aStream;
798 boost::property_tree::write_json(aStream, aTree);
799 aPayload = OString(aStream.str());
802 if (rVectorGraphicSearchContext.mbCurrentIsVectorGraphic)
810 bool bDuplicate = !pSelections->empty() && pSelections->back() == aSelection;
812 pSelections->push_back(aSelection);
824 std::shared_ptr<sd::DrawViewShell> pDrawViewShell (
825 std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell));
837 mpView = pViewShell->GetView();
838 mpWindow = pViewShell->GetActiveWindow();
840 auto& rVectorGraphicSearchContext =
mpImpl->getVectorGraphicSearchContext();
845 if (rVectorGraphicSearchContext.mbCurrentIsVectorGraphic)
847 OUString
const & rString =
mpSearchItem->GetSearchString();
851 aOptions.
meStartPosition = bBackwards ? SearchStartPosition::End : SearchStartPosition::Begin;
855 bool bResult = rVectorGraphicSearchContext.mpVectorGraphicSearch->search(rString, aOptions);
860 bResult = rVectorGraphicSearchContext.mpVectorGraphicSearch->previous();
862 bResult = rVectorGraphicSearchContext.mpVectorGraphicSearch->next();
872 std::vector<basegfx::B2DRectangle> aSubSelections;
875 aSubSelections.push_back(aSubSelection);
880 rVectorGraphicSearchContext.reset();
896 if (
mpSearchItem->GetCommand() != SvxSearchCmd::REPLACE_ALL)
905 if (nMatchCount==0 ||
mpSearchItem->GetCommand()==SvxSearchCmd::REPLACE_ALL)
909 if (!
mbEndOfSearch && !rVectorGraphicSearchContext.mbCurrentIsVectorGraphic)
919 "SearchAndReplace without valid view!" );
972 std::shared_ptr<sd::DrawViewShell> pDrawViewShell (
973 std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell));
976 if (pDrawViewShell !=
nullptr
977 && (aPosition.
meEditMode != pDrawViewShell->GetEditMode()
978 || aPosition.
mePageKind != pDrawViewShell->GetPageKind()))
984 if (pPageView !=
nullptr)
987 SetUpdateLayout(
false);
989 if (pOutlinerView !=
nullptr)
993 SetText(OUString(), GetParagraph(0));
1029 bool bSelectionHasChanged =
false;
1033 if (
mpObj !=
nullptr)
1049 if (pMark !=
nullptr)
1055 bSelectionHasChanged =
true;
1060 return bSelectionHasChanged;
1068 OSL_ASSERT(pViewShell);
1077 std::shared_ptr<sd::DrawViewShell> pDrawViewShell (
1078 std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell));
1079 if (pDrawViewShell !=
nullptr)
1107 if (pView !=
nullptr)
1118 bool bRestore =
true;
1125 if (pViewShell ==
nullptr)
1133 std::shared_ptr<sd::DrawViewShell> pDrawViewShell (
1134 std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell));
1136 if (pDrawViewShell !=
nullptr)
1153 if (pView !=
nullptr)
1164 return (pObject !=
nullptr) &&
pObject->HasText() && !
pObject->IsEmptyPresObj();
1172 auto const& pVectorGraphicData = pGraphicObject->GetGraphic().getVectorGraphicData();
1173 if (pVectorGraphicData && VectorGraphicDataType::Pdf == pVectorGraphicData->getType())
1197 auto& rVectorGraphicSearchContext =
mpImpl->getVectorGraphicSearchContext();
1198 rVectorGraphicSearchContext.reset();
1205 catch (
const css::uno::Exception&)
1209 SetUpdateLayout(
false);
1211 if (pOutlinerView !=
nullptr)
1215 SetText(OUString(), GetParagraph(0));
1232 rVectorGraphicSearchContext.reset();
1234 if (!bForbiddenPage)
1249 rVectorGraphicSearchContext.mbCurrentIsVectorGraphic =
true;
1258 if (rVectorGraphicSearchContext.mbCurrentIsVectorGraphic)
1263 OUString
const & rString =
mpSearchItem->GetSearchString();
1267 aOptions.
meStartPosition = bBackwards ? SearchStartPosition::End : SearchStartPosition::Begin;
1271 rVectorGraphicSearchContext.mpVectorGraphicSearch = std::make_unique<VectorGraphicSearch>(pGraphicObject->GetGraphic());
1273 bool bResult = rVectorGraphicSearchContext.mpVectorGraphicSearch->search(rString, aOptions);
1277 bResult = rVectorGraphicSearchContext.mpVectorGraphicSearch->previous();
1279 bResult = rVectorGraphicSearchContext.mpVectorGraphicSearch->next();
1293 std::vector<basegfx::B2DRectangle> aSubSelections;
1296 aSubSelections.push_back(aSubSelection);
1304 rVectorGraphicSearchContext.reset();
1312 if (pViewShell !=
nullptr)
1332 rVectorGraphicSearchContext.reset();
1350 OSL_ASSERT(pViewShell);
1381 if (pOutlinerView !=
nullptr)
1405 SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase();
1416 aString =
SdResId(STR_END_SPELLING_OBJ);
1418 aString =
SdResId(STR_END_SPELLING);
1423 VclMessageType::Info, VclButtonsType::Ok, aString));
1434 if (nCommand == SvxSearchCmd::REPLACE || nCommand == SvxSearchCmd::FIND)
1456 pStringId = bImpress ? STR_SAR_WRAP_FORWARD : STR_SAR_WRAP_FORWARD_DRAW;
1458 pStringId = bImpress ? STR_SAR_WRAP_BACKWARD : STR_SAR_WRAP_BACKWARD_DRAW;
1464 VclMessageType::Question, VclButtonsType::YesNo,
SdResId(pStringId)));
1465 sal_uInt16 nBoxResult = xQueryBox->run();
1467 return (nBoxResult ==
RET_YES);
1494 DBG_ASSERT(eState != EESpellState::NoSpeller,
"No SpellChecker");
1496 if (eState == EESpellState::Ok)
1533 if (pOutlinerView !=
nullptr)
1540 std::shared_ptr<sd::DrawViewShell> pDrawViewShell(
1541 std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell));
1542 if (pDrawViewShell ==
nullptr || ePageKind == pDrawViewShell->GetPageKind())
1546 pDrawViewShell->ChangeEditMode(
mpImpl->meOriginalEditMode,
false);
1571 if (pViewShell->GetView())
1572 xFuSearch = pViewShell->GetView()->getSearchContext().getFunctionSearch();
1587 if (xFuSearch.is() && pNewViewShell->GetView())
1588 pNewViewShell->GetView()->getSearchContext().setSearchFunction(xFuSearch);
1604 pDrawViewShell = std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell);
1605 OSL_ASSERT(pDrawViewShell !=
nullptr);
1606 if (pDrawViewShell !=
nullptr)
1607 mpImpl->meOriginalEditMode = pDrawViewShell->GetEditMode();
1615 std::shared_ptr<sd::DrawViewShell> pDrawViewShell(
1616 std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell));
1617 OSL_ASSERT(pDrawViewShell !=
nullptr);
1618 if (pDrawViewShell !=
nullptr)
1620 pDrawViewShell->ChangeEditMode(eEditMode,
false);
1621 pDrawViewShell->SwitchPage(nPageIndex);
1639 if (!(pViewShell && pViewShell->GetDispatcher()))
1642 pViewShell->GetDispatcher()->ExecuteList(
1643 SID_TEXTEDIT, SfxCallMode::SYNCHRON | SfxCallMode::RECORD, {&aItem});
1661 SetUpdateLayout(
true);
1663 pOutlinerView,
true,
true, bGrabFocus);
1680 sal_Int32 nParagraphCount = GetParagraphCount();
1681 if (nParagraphCount == 0)
1685 sal_Int32 nLastParagraphLength = GetEditEngine().GetTextLen (
1687 aPosition =
ESelection (nParagraphCount-1, nLastParagraphLength);
1698 DBG_ASSERT (pOutlinerView!=
nullptr,
"outline view in SdOutliner::HasNoPreviousMatch is NULL");
1707 bool bContinueSearch =
false;
1729 return bContinueSearch;
1744 if (pViewShell == rpViewShell)
1754 mpView = rpViewShell->GetView();
1756 mpWindow = rpViewShell->GetActiveWindow();
1760 if (pOutlinerView !=
nullptr)
1793 const vcl::Font *pTargetFont, sal_Int32 nOptions,
bool bIsInteractive )
1796 bool bMultiDoc =
nullptr !=
dynamic_cast< const sd::DrawViewShell *
>( pViewShell.get() );
1806 if (pOutlinerView !=
nullptr)
1826 SetUpdateLayout(
true);
1829 SetUpdateLayout(
false);
1841 SetUpdateLayout(
false);
1847 SetRefDevice(
SD_MOD()->GetVirtualRefDevice() );
1850 if (pBase !=
nullptr)
1890 if (pOutlinerView !=
nullptr)
1892 mpWindow = pViewShell->GetActiveWindow();
1929 pChildWindow = pViewFrm->GetChildWindow(
1930 SvxSearchDialogWrapper::GetChildWindowId());
1935 pChildWindow = pViewFrm->GetChildWindow(
1936 sd::SpellDialogChildWindow::GetChildWindowId());
1945 if (pChildWindow !=
nullptr)
1952 return pSearchDialog;
1955 auto pWin = pViewShell->GetActiveWindow();
1956 return pWin ? pWin->GetFrameWeld() :
nullptr;
1963 mbOwnOutlineView(false),
1964 mpOutlineView(nullptr)
1970 if (mbOwnOutlineView && mpOutlineView!=
nullptr)
1972 mpOutlineView->SetWindow(
nullptr);
1973 delete mpOutlineView;
1974 mpOutlineView =
nullptr;
1985 const std::shared_ptr<sd::ViewShell>& rpViewShell,
1988 if (rpViewShell ==
nullptr)
1991 switch (rpViewShell->GetShellType())
1999 bool bInsert =
false;
2000 if (mpOutlineView !=
nullptr && !mbOwnOutlineView)
2001 mpOutlineView =
nullptr;
2003 if (mpOutlineView ==
nullptr || !rOutliner.
GetEditEngine().
HasView(&mpOutlineView->GetEditView()))
2005 delete mpOutlineView;
2007 mbOwnOutlineView =
true;
2011 mpOutlineView->SetWindow(pWindow);
2015 mpOutlineView->SetControlWord(nStat);
2025 meOriginalEditMode =
2026 std::static_pointer_cast<sd::DrawViewShell>(rpViewShell)->GetEditMode();
2032 if (mpOutlineView!=
nullptr && mbOwnOutlineView)
2033 delete mpOutlineView;
2034 mpOutlineView = rOutliner.
GetView(0);
2035 mbOwnOutlineView =
false;
2049 if (mbOwnOutlineView)
2052 mpOutlineView =
nullptr;
2053 mbOwnOutlineView =
false;
2054 if (pView !=
nullptr)
2062 mpOutlineView =
nullptr;
static const AllSettings & GetSettings()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
bool HasView(EditView *pView) const
static css::uno::Reference< css::linguistic2::XSpellChecker1 > GetSpellChecker()
static css::uno::Reference< css::linguistic2::XHyphenator > GetHyphenator()
MapUnit GetMapUnit() const
void SetSelection(const ESelection &)
void StartTextConversion(weld::Widget *pDialogParent, LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont, sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc)
void GetSelectionRectangles(std::vector< tools::Rectangle > &rLogicRects) const
sal_Int32 StartSearchAndReplace(const SvxSearchItem &rSearchItem)
void SetOutputArea(const tools::Rectangle &rRect)
vcl::Window * GetWindow() const
ESelection GetSelection() const
void SetWindow(vcl::Window *pWindow)
EditView & GetEditView() const
void SetText(const OutlinerParaObject &)
const EditEngine & GetEditEngine() const
Paragraph * GetParagraph(sal_Int32 nAbsPos) const
void SetPaperSize(const Size &rSize)
bool SetUpdateLayout(bool bUpdate)
OutlinerView * GetView(size_t nIndex) const
size_t InsertView(OutlinerView *pView, size_t nIndex=size_t(-1))
size_t GetViewCount() const
SAL_DLLPRIVATE bool GetOnlineSpell() const
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
SAL_DLLPRIVATE DocumentType GetDocumentType() const
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
void ReleaseOutlinerView()
This method is called when the OutlinerView is no longer used.
sd::VectorGraphicSearchContext & getVectorGraphicSearchContext()
EditMode meOriginalEditMode
The original edit mode directly after switching to a different view mode.
sd::VectorGraphicSearchContext maVectorGraphicSearchContext
bool mbOwnOutlineView
Flag that specifies whether we own the outline view pointed to by <member>mpOutlineView</member> and ...
OutlinerView * mpOutlineView
The outline view used for searching and spelling.
void ProvideOutlinerView(Outliner &rOutliner, const std::shared_ptr< sd::ViewShell > &rpViewShell, vcl::Window *pWindow)
Provide in the member mpOutlineView an instance of OutlinerView that is either taken from the ViewShe...
OutlinerView * GetOutlinerView()
Return the OutlinerView that was provided by the last call to ProvideOutlinerView() (or NULL when the...
SdOutliner(SdDrawDocument *pDoc, OutlinerMode nMode)
Create a new sd outliner object.
bool HasNoPreviousMatch()
Detect whether there exists a previous match.
bool HandleFailedSearch()
Handle a failed search (with or without replace) for the outline mode.
void RememberStartPosition()
Remember the current edited object/caret position/page/view mode when starting to search/spell check ...
void PrepareSearchAndReplace()
Prepare to search and replace on the current text object.
void PrepareConversion()
Prepare to do a text conversion on the current text object.
void StartSpelling()
Initialize a spell check but do not start it yet.
std::unique_ptr< const SvxSearchItem > mpSearchItem
The search item contains various attributes that define the type of search.
SdrObject * mpObj
Current object that may be a text object.
sal_uInt16 mnStartPageIndex
The current page index on starting to search/spell check.
::std::vector< unotools::WeakReference< SdrObject > > maMarkListCopy
When the search is restricted to the current selection then this list contains pointers to all the ob...
void ProvideNextTextObject()
Provide next object to search or spell check as text object in edit mode on the current page.
void sendLOKSearchResultCallback(const std::shared_ptr< sd::ViewShell > &pViewShell, const OutlinerView *pOutlinerView, std::vector< sd::SearchSelection > *pSelections)
::sd::outliner::Iterator maObjectIterator
The actual object iterator.
sal_uInt16 mnPageCount
The number of pages in the current view.
bool mbStringFound
Specifies whether the search string has been found so far.
virtual bool SpellNextDocument() override
Initiate the spell check of the next relevant text object.
bool mbFoundObject
Set to <TRUE> when an object has been prepared successfully for searching/spell checking.
void DetectChange()
Detect changes of the document or view and react accordingly.
void ShowEndOfSearchDialog()
Show a dialog that tells the user that the search has ended either because there are no more matches ...
virtual ~SdOutliner() override
Nothing spectacular in the destructor.
EditMode meStartEditMode
The master page mode that was active when starting to search/spell check.
SdrObject * SetObject(const ::sd::outliner::IteratorPosition &rPosition)
Take a position as returned by an object iterator and switch to the view and page on which the object...
void PutTextIntoOutliner()
Put text of current text object into outliner so that the text can be searched/spell checked.
OutlinerParaObject * mpParaObj
Paragraph object of <member>mpTextObj</member>.
void HandleChangedSelection()
Activate or deactivate the search in the current selection.
bool mbRestrictSearchToSelection
This flag indicates that only the selected objects are to be searched.
bool SearchAndReplaceAll()
Do search and replace for whole document.
std::weak_ptr<::sd::ViewShell > mpWeakViewShell
The view shell containing the view.
VclPtr<::sd::Window > mpWindow
This window contains the view.
bool mbEndOfSearch
A <TRUE> value indicates that the end of the find&replace or spell check has been reached.
void SetViewShell(const std::shared_ptr<::sd::ViewShell > &rpViewShell)
Use this method when the view shell in which to search has changed.
void Initialize(bool bDirectionIsForward)
Initialize the object iterator.
bool mbDirectionIsForward
This flag indicates whether to search forward or backwards.
void SetPage(EditMode eEditMode, sal_uInt16 nPageIndex)
Switch to the page or master page specified by the <member>mnPage</member> index.
bool StartSearchAndReplace(const SvxSearchItem *pSearchItem)
Initiate a find and/or replace on the next relevant text object.
void PrepareSpelling()
Despite the name this method is called prior to spell checking and searching and replacing.
weld::Window * GetMessageBoxParent()
Find the right parent to use for a message.
void BeginConversion()
This is called internally when text conversion is started.
void StartConversion(LanguageType nSourceLanguage, LanguageType nTargetLanguage, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive)
Starts the text conversion (hangul/hanja or Chinese simplified/traditional) for the current viewshell...
void EndOfSearch()
Handle the situation that the iterator has reached the last object.
::sd::View * mpView
The view which displays the searched objects.
PageKind meStartViewMode
The view mode that was active when starting to search/spell check.
bool SearchAndReplaceOnce(std::vector<::sd::SearchSelection > *pSelections=nullptr)
Do search and replace for next match.
ESelection maStartSelection
The position of the caret when searching /spell checking was started.
void EndConversion()
Release all resources that have been created during the conversion.
::sd::outliner::IteratorPosition maCurrentPosition
The current position of the object iterator.
void PrepareSpellCheck()
Prepare to do spell checking on the current text object.
enum SdOutliner::mode meMode
::sd::outliner::IteratorPosition maLastValidPosition
The last valid position describes where the last text object has been found.
void SetViewMode(PageKind ePageKind)
Switch to a new view mode.
bool ShowWrapAroundDialog()
Show a dialog that asks the user whether to wrap around to the beginning/end of the document and cont...
LanguageType mnConversionLanguage
this is the language that is used for current text conversion.
SdDrawDocument * mpDrawDocument
The document on whose objects and pages this class operates.
::sd::outliner::Iterator maSearchStartPosition
The position when the search started.
ESelection GetSearchStartPosition() const
Return the position at which a new search is started with respect to the search direction as specifie...
SdrObject * mpStartEditedObject
The object in edit mode when searching /spell checking was started (if any).
sal_Int32 mnText
Current text to be searched/spelled inside the current text object.
bool ConvertNextDocument() override
callback for textconversion
::std::unique_ptr< Implementation > mpImpl
SdrTextObj * mpSearchSpellTextObj
Candidate for being searched/spell checked.
void EndSpelling()
Release all resources that have been created during the find&replace or spell check.
void EnterEditMode(bool bGrabFocus)
Switch on edit mode for the currently selected text object.
svx::SpellPortions GetNextSpellSentence()
Iterate over the sentences in all text shapes and stop at the next sentence with spelling errors.
SdrObject * mpFirstObj
this stores the first object that is used for text conversion.
OutlinerView * getOutlinerView()
Returns the current outline view.
bool DetectSelectionChange()
Detect whether the selection has changed.
bool mbPrepareSpellingPending
When this flag is true then a PrepareSpelling() is executed when StartSearchAndReplace() is called th...
bool mbMatchMayExist
This flag indicates whether there may exist a match of the search string before/after the current pos...
void RestoreStartPosition()
Restore the position stored in the last call of <member>RememberStartPositiony</member>.
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
const SfxItemPool & GetItemPool() const
SfxStyleSheetBasePool * GetStyleSheetPool() const
const std::shared_ptr< SvxForbiddenCharactersTable > & GetForbiddenCharsTable() const
SdrTextObj * GetTextEditObject() const
virtual bool IsTextEdit() const final override
bool IsEmptyPresObj() const
SdrPageView * GetSdrPageView() const
virtual const tools::Rectangle & GetLogicRect() const override
virtual bool HasText() const override
virtual void setActiveText(sal_Int32 nIndex)
virtual SdrText * getText(sal_Int32 nIndex) const override
OutlinerParaObject * GetOutlinerParaObject()
std::shared_ptr< SfxDialogController > & GetController()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
void setTiledSearching(bool bTiledSearching)
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
css::uno::Any GetProperty(std::u16string_view rPropertyName) const
static void SetSearchLabel(const SearchLabel &rSL)
SvxSearchCmd GetCommand() const
virtual SvxSearchItem * Clone(SfxItemPool *pPool=nullptr) const override
void translate(double fX, double fY)
void scale(double fX, double fY)
void expand(const Tuple2D< TYPE > &rTuple)
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
Derivative of sd::View; contains also a pointer to the document.
Show a textual overview of the text contents of all slides.
Derivative of sd::View for the outline mode |* .
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
static ViewShellBase * GetViewShellBase(SfxViewFrame const *pFrame)
When given a view frame this static method returns the corresponding sd::ViewShellBase object.
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true) override
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
static const OUString msHandoutViewURL
static const OUString msCenterPaneURL
static const OUString msNotesViewURL
static ::std::shared_ptr< FrameworkHelper > Instance(ViewShellBase &rBase)
Return the FrameworkHelper object that is associated with the given ViewShellBase.
static const OUString msImpressViewURL
Data collection specifying a <type>SdrObject</type> and its position in a document and view.
PageKind mePageKind
Page kind of the view.
EditMode meEditMode
Edit mode of the view.
sal_Int32 mnPageIndex
The index of a page where the object is located on.
sal_Int32 mnText
Number of the actual SdrText from the current <type>SdrObject</type>
::unotools::WeakReference< SdrObject > mxObject
Pointer to the actual <type>SdrObject</type> object.
This iterator can be used to iterate over all <type>SdrObject</type> objects of one of three set deno...
void Reverse()
Reverse the direction of iteration.
This class wraps the <type>SdOutliner</type> class and represents it as a container of <type>SdrObjec...
Iterator current()
Return an iterator that points to the current object of one of the sets described above.
Iterator begin()
Return an iterator that points to the first object of one of the sets described above.
const MapMode & GetMapMode() const
#define DBG_ASSERT(sCon, aError)
#define DBG_UNHANDLED_EXCEPTION(...)
virtual void SetText(const OUString &rStr) override
EmbeddedObjectRef * pObject
constexpr OUStringLiteral UPN_IS_SPELL_AUTO
#define LINK(Instance, Class, Member)
OString join(std::string_view rSeparator, const std::vector< OString > &rSequence)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
std::vector< SpellPortion > SpellPortions
OUString SdResId(TranslateId aId)
SearchStartPosition meStartPosition
Describes a single search hit: a set of rectangles on a given page.
Reference< XController > xController
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
void GetSelection(struct ESelection &rSel, SvxTextForwarder const *pForwarder) noexcept
VclPtr< vcl::Window > mpWindow