LibreOffice Module sd (master) 1
|
The main purpose of this class is searching and replacing as well as spelling of impress documents. More...
#include <Outliner.hxx>
Classes | |
class | Implementation |
Public Member Functions | |
SdOutliner (SdDrawDocument *pDoc, OutlinerMode nMode) | |
Create a new sd outliner object. More... | |
virtual | ~SdOutliner () override |
Nothing spectacular in the destructor. More... | |
SdOutliner (const Outliner &)=delete | |
Forbid copy construction and copy assignment. More... | |
SdOutliner & | operator= (const Outliner &)=delete |
void | PrepareSpelling () |
Despite the name this method is called prior to spell checking and searching and replacing. More... | |
void | StartSpelling () |
Initialize a spell check but do not start it yet. More... | |
bool | StartSearchAndReplace (const SvxSearchItem *pSearchItem) |
Initiate a find and/or replace on the next relevant text object. More... | |
svx::SpellPortions | GetNextSpellSentence () |
Iterate over the sentences in all text shapes and stop at the next sentence with spelling errors. More... | |
void | EndSpelling () |
Release all resources that have been created during the find&replace or spell check. More... | |
bool | ConvertNextDocument () override |
callback for textconversion More... | |
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. More... | |
void | BeginConversion () |
This is called internally when text conversion is started. More... | |
void | EndConversion () |
Release all resources that have been created during the conversion. More... | |
int | GetIgnoreCurrentPageChangesLevel () const |
void | IncreIgnoreCurrentPageChangesLevel () |
void | DecreIgnoreCurrentPageChangesLevel () |
SdDrawDocument * | GetDoc () const |
Public Member Functions inherited from SdrOutliner | |
SdrOutliner (SfxItemPool *pItemPool, OutlinerMode nMode) | |
virtual | ~SdrOutliner () override |
void | SetTextObj (const SdrTextObj *pObj) |
void | SetTextObjNoInit (const SdrTextObj *pObj) |
const SdrTextObj * | GetTextObj () const |
void | setVisualizedPage (const SdrPage *pPage) |
const SdrPage * | getVisualizedPage () const |
virtual OUString | CalcFieldValue (const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rpTxtColor, std::optional< Color > &rpFldColor, std::optional< FontLineStyle > &rpFldLineStyle) override |
bool | hasEditViewCallbacks () const |
virtual std::optional< bool > | GetCompatFlag (SdrCompatibilityFlag eFlag) const override |
Private Types | |
enum | mode { SEARCH , SPELL , TEXT_CONVERSION } |
Specifies whether to search and replace, to spell check or to do a text conversion. More... | |
Private Member Functions | |
OutlinerView * | getOutlinerView () |
Returns the current outline view. More... | |
void | Initialize (bool bDirectionIsForward) |
Initialize the object iterator. More... | |
bool | SearchAndReplaceAll () |
Do search and replace for whole document. More... | |
bool | SearchAndReplaceOnce (std::vector<::sd::SearchSelection > *pSelections=nullptr) |
Do search and replace for next match. More... | |
void | sendLOKSearchResultCallback (const std::shared_ptr< sd::ViewShell > &pViewShell, const OutlinerView *pOutlinerView, std::vector< sd::SearchSelection > *pSelections) |
void | DetectChange () |
Detect changes of the document or view and react accordingly. More... | |
bool | DetectSelectionChange () |
Detect whether the selection has changed. More... | |
void | RememberStartPosition () |
Remember the current edited object/caret position/page/view mode when starting to search/spell check so that it can be restored on termination. More... | |
void | RestoreStartPosition () |
Restore the position stored in the last call of <member>RememberStartPositiony</member>. More... | |
void | ProvideNextTextObject () |
Provide next object to search or spell check as text object in edit mode on the current page. More... | |
void | EndOfSearch () |
Handle the situation that the iterator has reached the last object. More... | |
void | ShowEndOfSearchDialog () |
Show a dialog that tells the user that the search has ended either because there are no more matches after finding at least one or that no match has been found at all. More... | |
bool | ShowWrapAroundDialog () |
Show a dialog that asks the user whether to wrap around to the beginning/end of the document and continue with the search/spell check. More... | |
void | PutTextIntoOutliner () |
Put text of current text object into outliner so that the text can be searched/spell checked. More... | |
void | PrepareSpellCheck () |
Prepare to do spell checking on the current text object. More... | |
void | PrepareSearchAndReplace () |
Prepare to search and replace on the current text object. More... | |
void | PrepareConversion () |
Prepare to do a text conversion on the current text object. More... | |
void | SetViewMode (PageKind ePageKind) |
Switch to a new view mode. More... | |
void | SetPage (EditMode eEditMode, sal_uInt16 nPageIndex) |
Switch to the page or master page specified by the <member>mnPage</member> index. More... | |
void | EnterEditMode (bool bGrabFocus) |
Switch on edit mode for the currently selected text object. More... | |
ESelection | GetSearchStartPosition () const |
Return the position at which a new search is started with respect to the search direction as specified by the argument. More... | |
bool | HasNoPreviousMatch () |
Detect whether there exists a previous match. More... | |
bool | HandleFailedSearch () |
Handle a failed search (with or without replace) for the outline mode. More... | |
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 specified by this position is located. More... | |
void | SetViewShell (const std::shared_ptr<::sd::ViewShell > &rpViewShell) |
Use this method when the view shell in which to search has changed. More... | |
void | HandleChangedSelection () |
Activate or deactivate the search in the current selection. More... | |
virtual bool | SpellNextDocument () override |
Initiate the spell check of the next relevant text object. More... | |
weld::Window * | GetMessageBoxParent () |
Find the right parent to use for a message. More... | |
Private Attributes | |
::std::unique_ptr< Implementation > | mpImpl |
enum SdOutliner::mode | meMode |
::sd::View * | mpView |
The view which displays the searched objects. More... | |
std::weak_ptr<::sd::ViewShell > | mpWeakViewShell |
The view shell containing the view. More... | |
VclPtr<::sd::Window > | mpWindow |
This window contains the view. More... | |
SdDrawDocument * | mpDrawDocument |
The document on whose objects and pages this class operates. More... | |
LanguageType | mnConversionLanguage |
this is the language that is used for current text conversion. More... | |
int | mnIgnoreCurrentPageChangesLevel |
While the value of this flag is greater than 0 changes of the current page do not lead to selecting the corresponding text in the outliner. More... | |
bool | mbStringFound |
Specifies whether the search string has been found so far. More... | |
bool | mbMatchMayExist |
This flag indicates whether there may exist a match of the search string before/after the current position in the document. More... | |
sal_uInt16 | mnPageCount |
The number of pages in the current view. More... | |
bool | mbEndOfSearch |
A <TRUE> value indicates that the end of the find&replace or spell check has been reached. More... | |
bool | mbFoundObject |
Set to <TRUE> when an object has been prepared successfully for searching/spell checking. More... | |
bool | mbDirectionIsForward |
This flag indicates whether to search forward or backwards. More... | |
bool | mbRestrictSearchToSelection |
This flag indicates that only the selected objects are to be searched. More... | |
::std::vector< unotools::WeakReference< SdrObject > > | maMarkListCopy |
When the search is restricted to the current selection then this list contains pointers to all the objects of the selection. More... | |
SdrObject * | mpObj |
Current object that may be a text object. More... | |
SdrObject * | mpFirstObj |
this stores the first object that is used for text conversion. More... | |
SdrTextObj * | mpSearchSpellTextObj |
Candidate for being searched/spell checked. More... | |
sal_Int32 | mnText |
Current text to be searched/spelled inside the current text object. More... | |
OutlinerParaObject * | mpParaObj |
Paragraph object of <member>mpTextObj</member>. More... | |
PageKind | meStartViewMode |
The view mode that was active when starting to search/spell check. More... | |
EditMode | meStartEditMode |
The master page mode that was active when starting to search/spell check. More... | |
sal_uInt16 | mnStartPageIndex |
The current page index on starting to search/spell check. More... | |
SdrObject * | mpStartEditedObject |
The object in edit mode when searching /spell checking was started (if any). More... | |
ESelection | maStartSelection |
The position of the caret when searching /spell checking was started. More... | |
std::unique_ptr< const SvxSearchItem > | mpSearchItem |
The search item contains various attributes that define the type of search. More... | |
::sd::outliner::Iterator | maObjectIterator |
The actual object iterator. More... | |
::sd::outliner::IteratorPosition | maCurrentPosition |
The current position of the object iterator. More... | |
::sd::outliner::Iterator | maSearchStartPosition |
The position when the search started. More... | |
::sd::outliner::IteratorPosition | maLastValidPosition |
The last valid position describes where the last text object has been found. More... | |
bool | mbPrepareSpellingPending |
When this flag is true then a PrepareSpelling() is executed when StartSearchAndReplace() is called the next time. More... | |
Friends | |
class | ::sd::outliner::OutlinerContainer |
The main purpose of this class is searching and replacing as well as spelling of impress documents.
The main part of both tasks lies in iterating over the pages and view modes of a document and apply the respective function to all objects containing text on those pages.
Relevant objects: There are two sets of objects to search/spell check. One is the set of all selected objects. The other consists of all objects on all pages in draw-, notes-, and handout view as well as slide- and background view (draw pages and master pages).
Iteration: Search/replace and spelling functions operate on shapes containing text. To cover all relevant objects an order has to be defined on the objects. For the set of all selected objects this order is simply the order in which they can be retrieved from the selection object.
When there is no selection the order is nested. The three modes of the draw view are on the outer level: draw mode, notes mode, handout mode. The inner level switches between draw pages and master pages. This leads to the following order:
Iteration starts at the top of the current page. When reaching the end of the document, i.e. the last master page of the handout mode, it jumps to the first draw page of draw mode. In backward searches this order is reversed. When doing a replace all then the whole document is searched for matches starting at the first page of the draw/slide view (or last page of handout/background view even though search direction).
The start position is restored after finishing spell checking or replacing all matches in a document.
Some related pieces of information: The search dialog (<type>SvxSearchDialog</type>) can be controlled in more than one way:
The <member>HasSelection()</member> view shell method that returns whether or not a selection exists. However, it is called from the search dialog with an argument so that only text selections are queried. This is only sufficient for searching the outline view.
Definition at line 122 of file Outliner.hxx.
|
private |
Specifies whether to search and replace, to spell check or to do a text conversion.
Enumerator | |
---|---|
SEARCH | |
SPELL | |
TEXT_CONVERSION |
Definition at line 207 of file Outliner.hxx.
SdOutliner::SdOutliner | ( | SdDrawDocument * | pDoc, |
OutlinerMode | nMode | ||
) |
Create a new sd outliner object.
pDoc | The draw document from which to take the content. |
nMode | The valid values <const>OutlinerMode::DontKnow</const>, <const>OutlinerMode::TextObject</const>, <const>OutlinerMode::TitleObject</const>, <const>OutlinerMode::OutlineObject</const>, and <const>OutlinerMode::OutlineView</const> are defined in editeng/outliner.hxx. |
Definition at line 132 of file Outliner.cxx.
References Any, SdDrawDocument::GetDocSh(), SdrModel::GetForbiddenCharsTable(), LinguMgr::GetHyphenator(), SdrModel::GetItemPool(), SdDrawDocument::GetOnlineSpell(), SvtLinguConfig::GetProperty(), Application::GetSettings(), LinguMgr::GetSpellChecker(), SdrModel::GetStyleSheetPool(), LANGUAGE_NONE, LINK, meMode, mpDrawDocument, mpView, mpWindow, SD_MOD, SEARCH, Standard, and UPN_IS_SPELL_AUTO.
|
overridevirtual |
Nothing spectacular in the destructor.
Definition at line 212 of file Outliner.cxx.
|
delete |
Forbid copy construction and copy assignment.
void SdOutliner::BeginConversion | ( | ) |
This is called internally when text conversion is started.
The position of current view mode/page/object/caret position is remembered and will be restored after conversion.
Definition at line 1845 of file Outliner.cxx.
References sd::ViewShellBase::GetMainViewShell(), HandleChangedSelection(), maObjectIterator, maSearchStartPosition, mbMatchMayExist, mbStringFound, mpImpl, mpWeakViewShell, mpWindow, RememberStartPosition(), SD_MOD, and SetViewShell().
Referenced by StartConversion(), and sd::FuHangulHanjaConversion::StartConversion().
|
override |
callback for textconversion
Definition at line 1879 of file Outliner.cxx.
References SdDrawDocument::GetDocSh(), getOutlinerView(), Initialize(), mbEndOfSearch, mnText, mpDrawDocument, mpFirstObj, mpObj, mpWeakViewShell, mpWindow, ProvideNextTextObject(), and OutlinerView::SetWindow().
|
inline |
Definition at line 195 of file Outliner.hxx.
References mnIgnoreCurrentPageChangesLevel.
|
private |
Detect changes of the document or view and react accordingly.
Try to detect whether the document or the view (shell) has changed since the last time <member>StartSearchAndReplace()</member> has been called.
Such changes may occur because different calls to <member>SearchAndReplace()</member> there usually is user interaction. This is at least the press of the search or replace button but may include any other action some of which affect the search.
Definition at line 967 of file Outliner.cxx.
References sd::outliner::OutlinerContainer::current(), DetectSelectionChange(), getOutlinerView(), SdDrawDocument::GetSdPageCount(), SdrPaintView::GetSdrPageView(), HandleChangedSelection(), maCurrentPosition, maObjectIterator, MasterPage, sd::outliner::IteratorPosition::meEditMode, meMode, sd::outliner::IteratorPosition::mePageKind, mnPageCount, mpDrawDocument, mpView, mpWeakViewShell, Page, RememberStartPosition(), sd::View::SdrEndTextEdit(), OutlinerView::SetOutputArea(), SetPaperSize, SetText(), SPELL, and SdrMarkView::UnmarkAllObj().
Referenced by GetNextSpellSentence(), and SearchAndReplaceOnce().
|
private |
Detect whether the selection has changed.
Definition at line 1027 of file Outliner.cxx.
References SdrMarkList::GetMark(), SdrMarkList::GetMarkCount(), SdrMarkView::GetMarkedObjectList(), SdrMark::GetMarkedSdrObj(), mbRestrictSearchToSelection, mpObj, and mpView.
Referenced by DetectChange().
void SdOutliner::EndConversion | ( | ) |
Release all resources that have been created during the conversion.
Definition at line 1874 of file Outliner.cxx.
References EndSpelling().
Referenced by StartConversion(), sd::FuHangulHanjaConversion::StartConversion(), and sd::FuHangulHanjaConversion::~FuHangulHanjaConversion().
|
private |
Handle the situation that the iterator has reached the last object.
This may result in setting the <member>mbEndOfSearch</member> flag back to </sal_False>. This method may show either the end-of-search dialog or the wrap-around dialog.
Definition at line 1345 of file Outliner.cxx.
References sd::outliner::OutlinerContainer::begin(), getOutlinerView(), GetSearchStartPosition(), maLastValidPosition, maObjectIterator, mbEndOfSearch, mbMatchMayExist, mbRestrictSearchToSelection, meMode, mpWeakViewShell, SetObject(), OutlinerView::SetSelection(), ShowEndOfSearchDialog(), ShowWrapAroundDialog(), and TEXT_CONVERSION.
Referenced by GetNextSpellSentence(), ProvideNextTextObject(), and SpellNextDocument().
void SdOutliner::EndSpelling | ( | ) |
Release all resources that have been created during the find&replace or spell check.
Free all resources acquired during the search/spell check.
After a spell check the start position is restored here.
Definition at line 281 of file Outliner.cxx.
References sd::ViewShellBase::GetMainViewShell(), getOutlinerView(), SdrPaintView::GetSdrPageView(), SdrModel::IsChanged(), meMode, mnStartPageIndex, mpDrawDocument, mpImpl, mpView, mpWeakViewShell, mpWindow, RestoreStartPosition(), sd::View::SdrEndTextEdit(), SdDrawDocument::SetChanged(), SPELL, TEXT_CONVERSION, and SdrMarkView::UnmarkAllObj().
Referenced by EndConversion(), sd::FuSearch::SearchAndReplace(), StartSearchAndReplace(), and sd::FuSearch::~FuSearch().
|
private |
Switch on edit mode for the currently selected text object.
Definition at line 1626 of file Outliner.cxx.
References SdrTextObj::GetLogicRect(), getOutlinerView(), SdrPaintView::GetSdrPageView(), tools::Rectangle::GetSize(), SdrObjEditView::IsTextEdit(), SdrMarkView::MarkObj(), mbFoundObject, mnText, mpSearchSpellTextObj, mpView, mpWeakViewShell, mpWindow, sd::View::SdrBeginTextEdit(), sd::View::SdrEndTextEdit(), SdrTextObj::setActiveText(), OutlinerView::SetOutputArea(), SetPaperSize, and SdrMarkView::UnmarkAllObj().
Referenced by PrepareConversion(), PrepareSearchAndReplace(), PrepareSpellCheck(), and RestoreStartPosition().
|
inline |
Definition at line 196 of file Outliner.hxx.
References mpDrawDocument.
|
inline |
Definition at line 193 of file Outliner.hxx.
References mnIgnoreCurrentPageChangesLevel.
|
private |
Find the right parent to use for a message.
This function makes sure that the otherwise non-modal search or spell dialogs, if visible, are locked, too.
Definition at line 1915 of file Outliner.cxx.
References SfxViewFrame::Current(), SfxChildWindow::GetController(), meMode, mpWeakViewShell, SEARCH, SPELL, TEXT_CONVERSION, and xController.
Referenced by ShowEndOfSearchDialog(), ShowWrapAroundDialog(), and StartConversion().
svx::SpellPortions SdOutliner::GetNextSpellSentence | ( | ) |
Iterate over the sentences in all text shapes and stop at the next sentence with spelling errors.
check next text object
While doing so the view mode may be changed and text shapes are set into edit mode.
Definition at line 378 of file Outliner.cxx.
References DetectChange(), EndOfSearch(), OutlinerView::GetEditView(), OutlinerView::GetSelection(), maStartSelection, mbMatchMayExist, and SpellNextDocument().
|
private |
Returns the current outline view.
Definition at line 216 of file Outliner.cxx.
References mpImpl.
Referenced by ConvertNextDocument(), DetectChange(), EndOfSearch(), EndSpelling(), EnterEditMode(), HandleFailedSearch(), HasNoPreviousMatch(), Initialize(), PrepareSearchAndReplace(), ProvideNextTextObject(), RestoreStartPosition(), SearchAndReplaceAll(), SearchAndReplaceOnce(), SetViewShell(), SpellNextDocument(), and StartConversion().
|
private |
Return the position at which a new search is started with respect to the search direction as specified by the argument.
Definition at line 1668 of file Outliner.cxx.
References mbDirectionIsForward.
Referenced by EndOfSearch(), HasNoPreviousMatch(), PrepareSearchAndReplace(), SearchAndReplaceAll(), and SearchAndReplaceOnce().
|
private |
Activate or deactivate the search in the current selection.
Call this method whenever the selection has changed. This method creates a copy of the current selection and reassigns the object iterator to the current() iterator.
Definition at line 1770 of file Outliner.cxx.
References SdrMarkView::AreObjectsMarked(), SdrMarkList::GetMark(), SdrMarkList::GetMarkCount(), SdrMarkView::GetMarkedObjectList(), SdrMark::GetMarkedSdrObj(), i, maMarkListCopy, mbRestrictSearchToSelection, mpView, and nCount.
Referenced by BeginConversion(), DetectChange(), and PrepareSpelling().
|
private |
Handle a failed search (with or without replace) for the outline mode.
Show message boxes when the search failed completely, i.e. there is no match in the whole presentation, or when no further match exists.
Definition at line 1705 of file Outliner.cxx.
References getOutlinerView(), HasNoPreviousMatch(), mpSearchItem, SvxSearchDialogWrapper::SetSearchLabel(), and ShowWrapAroundDialog().
Referenced by SearchAndReplaceOnce().
|
private |
Detect whether there exists a previous match.
Note that only the absence of such a match can be detected reliably. An existing match is assumed when the search started not at the beginning/end of the presentation. This does not have to be true. The user can have set the cursor at the middle of the text without a prior search.
Definition at line 1694 of file Outliner.cxx.
References DBG_ASSERT, getOutlinerView(), GetSearchStartPosition(), and OutlinerView::GetSelection().
Referenced by HandleFailedSearch().
|
inline |
Definition at line 194 of file Outliner.hxx.
References mnIgnoreCurrentPageChangesLevel.
|
private |
Initialize the object iterator.
Call this method after being invoked from the search or spellcheck dialog. It creates a new iterator pointing at the current object when this has not been done before. It reverses the direction of iteration if the given flag differs from the current direction.
bDirectionIsForward | This flag specifies in which direction to iterator over the objects. If it differs from the current direction the iterator is reversed. |
Definition at line 510 of file Outliner.cxx.
References sd::outliner::OutlinerContainer::begin(), sd::outliner::OutlinerContainer::current(), end, getOutlinerView(), OutlinerView::GetSelection(), maCurrentPosition, maLastValidPosition, maObjectIterator, mbDirectionIsForward, mbMatchMayExist, mpWeakViewShell, ESelection::nEndPara, ESelection::nEndPos, ESelection::nStartPara, ESelection::nStartPos, sd::outliner::Iterator::Reverse(), and OutlinerView::SetSelection().
Referenced by ConvertNextDocument(), SpellNextDocument(), and StartSearchAndReplace().
|
delete |
|
private |
Prepare to do a text conversion on the current text object.
This includes putting it into edit mode.
Definition at line 1824 of file Outliner.cxx.
References EnterEditMode(), SdDrawDocument::GetDocSh(), mbMatchMayExist, mbStringFound, mnConversionLanguage, and mpDrawDocument.
Referenced by ProvideNextTextObject().
|
private |
Prepare to search and replace on the current text object.
This includes putting it into edit mode.
Definition at line 1516 of file Outliner.cxx.
References EnterEditMode(), SdDrawDocument::GetDocSh(), getOutlinerView(), GetSearchStartPosition(), maCurrentPosition, mbMatchMayExist, mbStringFound, mpDrawDocument, mpObj, mpSearchItem, SetObject(), and OutlinerView::SetSelection().
Referenced by ProvideNextTextObject().
|
private |
Prepare to do spell checking on the current text object.
This includes putting it into edit mode. Under certain conditions this method sets <member>mbEndOfSearch</member> to <TRUE>.
Definition at line 1491 of file Outliner.cxx.
References DBG_ASSERT, EnterEditMode(), maObjectIterator, maSearchStartPosition, mbEndOfSearch, meMode, and SPELL.
Referenced by ProvideNextTextObject().
void SdOutliner::PrepareSpelling | ( | ) |
Despite the name this method is called prior to spell checking and searching and replacing.
Prepare find&replace or spellchecking.
The position of current view mode/page/object/caret position is remembered and, depending on the search mode, may be restored after finishing searching/spell checking.
This distinguishes between three cases:
The current shell is a <type>DrawViewShell</type>: Create a <type>OutlinerView</type> object and search all objects of (i) the current mark list, (ii) of the current view, or (iii) of all the view combinations:
Definition at line 241 of file Outliner.cxx.
References sd::ViewShellBase::GetMainViewShell(), HandleChangedSelection(), maObjectIterator, maSearchStartPosition, mbMatchMayExist, mbPrepareSpellingPending, mbStringFound, mpImpl, mpWeakViewShell, mpWindow, RememberStartPosition(), SD_MOD, and SetViewShell().
Referenced by sd::FuSearch::DoExecute(), sd::FuHangulHanjaConversion::FuHangulHanjaConversion(), sd::FuSearch::SearchAndReplace(), SetViewMode(), and StartSearchAndReplace().
|
private |
Provide next object to search or spell check as text object in edit mode on the current page.
The main purpose of this method is to iterate over all shape objects of the search area (current selection, current view, or whole document) until a text object has been found that contains at least one match or until no such object can be found anymore.
This skips all objects that do not match or are no text object.
These two conditions are expressed by setting one of the flags <member>mbFoundObject</member> or <member>mbEndOfSearch</member> to <TRUE>.
Definition at line 1191 of file Outliner.cxx.
References DBG_UNHANDLED_EXCEPTION, end, EndOfSearch(), unotools::WeakReference< class interface_type >::get(), SdDrawDocument::GetDocSh(), getOutlinerView(), SdrPaintView::GetSdrPageView(), comphelper::LibreOfficeKit::isActive(), basegfx::Range2D< typename TYPE, typename TRAITS >::isEmpty(), maCurrentPosition, maObjectIterator, SdrMarkView::MarkObj(), mbEndOfSearch, mbFoundObject, VectorGraphicSearchOptions::mbMatchCase, mbMatchMayExist, VectorGraphicSearchOptions::mbMatchWholeWord, mbStringFound, sd::outliner::IteratorPosition::meEditMode, meMode, sd::outliner::IteratorPosition::mePageKind, VectorGraphicSearchOptions::meStartPosition, mpDrawDocument, mpImpl, mpObj, mpParaObj, mpSearchItem, mpSearchSpellTextObj, mpView, mpWeakViewShell, sd::outliner::IteratorPosition::mxObject, Page, PrepareConversion(), PrepareSearchAndReplace(), PrepareSpellCheck(), PutTextIntoOutliner(), sd::View::SdrEndTextEdit(), SEARCH, SetObject(), OutlinerView::SetOutputArea(), SetPaperSize, SetText(), SPELL, Standard, TEXT_CONVERSION, and SdrMarkView::UnmarkAllObj().
Referenced by ConvertNextDocument(), SearchAndReplaceAll(), SearchAndReplaceOnce(), and SpellNextDocument().
|
private |
Put text of current text object into outliner so that the text can be searched/spell checked.
Definition at line 1470 of file Outliner.cxx.
References DynCastSdrTextObj(), SdrText::GetOutlinerParaObject(), SdrTextObj::getText(), SdrTextObj::HasText(), SdrObject::IsEmptyPresObj(), maCurrentPosition, sd::outliner::IteratorPosition::mnText, mpObj, mpParaObj, mpSearchSpellTextObj, and SetText().
Referenced by ProvideNextTextObject(), and RestoreStartPosition().
|
private |
Remember the current edited object/caret position/page/view mode when starting to search/spell check so that it can be restored on termination.
Definition at line 1063 of file Outliner.cxx.
References OutlinerView::GetSelection(), SdrObjEditView::GetTextEditObject(), Outliner::GetView(), Outliner::GetViewCount(), maStartSelection, meStartEditMode, meStartViewMode, mnStartPageIndex, mpStartEditedObject, mpView, and mpWeakViewShell.
Referenced by BeginConversion(), DetectChange(), PrepareSpelling(), SearchAndReplaceAll(), and StartSearchAndReplace().
|
private |
Restore the position stored in the last call of <member>RememberStartPositiony</member>.
Definition at line 1116 of file Outliner.cxx.
References EnterEditMode(), getOutlinerView(), maStartSelection, meStartEditMode, meStartViewMode, mnStartPageIndex, mpObj, mpStartEditedObject, mpWeakViewShell, PutTextIntoOutliner(), SetPage(), OutlinerView::SetSelection(), and SetViewMode().
Referenced by EndSpelling(), SearchAndReplaceAll(), and StartSearchAndReplace().
|
private |
Do search and replace for whole document.
Definition at line 580 of file Outliner.cxx.
References sd::outliner::OutlinerContainer::begin(), getOutlinerView(), GetSearchStartPosition(), comphelper::LibreOfficeKit::isActive(), comphelper::string::join(), SfxViewShell::libreOfficeKitViewCallback(), maObjectIterator, mbStringFound, mnStartPageIndex, mpSearchItem, mpWeakViewShell, ProvideNextTextObject(), RememberStartPosition(), RestoreStartPosition(), SearchAndReplaceOnce(), OutlinerView::SetSelection(), and SfxViewShell::setTiledSearching().
Referenced by StartSearchAndReplace().
|
private |
Do search and replace for next match.
pSelections | When tiled rendering and not 0, then don't emit LOK events, instead assume the caller will do so. |
Definition at line 816 of file Outliner.cxx.
References sd::outliner::OutlinerContainer::current(), DBG_ASSERT, DetectChange(), SdDrawDocument::GetDocSh(), getOutlinerView(), SdrPaintView::GetSdrPageView(), GetSearchStartPosition(), GetSelection(), HandleFailedSearch(), comphelper::LibreOfficeKit::isActive(), basegfx::Range2D< typename TYPE, typename TRAITS >::isEmpty(), maCurrentPosition, maLastValidPosition, maObjectIterator, SdrMarkView::MarkObj(), mbEndOfSearch, VectorGraphicSearchOptions::mbMatchCase, VectorGraphicSearchOptions::mbMatchWholeWord, mbStringFound, meMode, VectorGraphicSearchOptions::meStartPosition, sd::outliner::IteratorPosition::mnPageIndex, mpDrawDocument, mpImpl, mpObj, mpSearchItem, mpView, mpWeakViewShell, mpWindow, ProvideNextTextObject(), SEARCH, sendLOKSearchResultCallback(), OutlinerView::SetSelection(), OutlinerView::SetWindow(), OutlinerView::StartSearchAndReplace(), and SdrMarkView::UnmarkAllObj().
Referenced by SearchAndReplaceAll(), and StartSearchAndReplace().
|
private |
Definition at line 738 of file Outliner.cxx.
References o3tl::convert(), basegfx::Range2D< typename TYPE, typename TRAITS >::getHeight(), vcl::Window::GetMapMode(), MapMode::GetMapUnit(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinX(), basegfx::Range2D< typename TYPE, typename TRAITS >::getMinY(), OutlinerView::GetSelectionRectangles(), basegfx::Range2D< typename TYPE, typename TRAITS >::getWidth(), OutlinerView::GetWindow(), comphelper::string::join(), SfxViewShell::libreOfficeKitViewCallback(), maCurrentPosition, o3tl::mm100, sd::outliner::IteratorPosition::mnPageIndex, mpImpl, mpObj, mpSearchItem, and o3tl::twip.
Referenced by SearchAndReplaceOnce().
|
private |
Take a position as returned by an object iterator and switch to the view and page on which the object specified by this position is located.
rPosition | This position points to a <type>SdrObject</type> object and contains the view and page where it is located. |
Definition at line 1732 of file Outliner.cxx.
References unotools::WeakReference< class interface_type >::get(), sd::outliner::IteratorPosition::meEditMode, sd::outliner::IteratorPosition::mePageKind, sd::outliner::IteratorPosition::mnPageIndex, mnText, sd::outliner::IteratorPosition::mnText, sd::outliner::IteratorPosition::mxObject, SetPage(), and SetViewMode().
Referenced by EndOfSearch(), PrepareSearchAndReplace(), and ProvideNextTextObject().
|
private |
Switch to the page or master page specified by the <member>mnPage</member> index.
Master page mode is specified by <member>meEditMode</member>.
eEditMode | The new edit mode. |
nPageIndex | The new page index. |
Definition at line 1610 of file Outliner.cxx.
References mbRestrictSearchToSelection, and mpWeakViewShell.
Referenced by RestoreStartPosition(), and SetObject().
|
private |
Switch to a new view mode.
Try to restore the original edit mode before doing so.
ePageKind | Specifies the new view mode. |
Definition at line 1537 of file Outliner.cxx.
References sd::ViewShellBase::GetMainViewShell(), SdDrawDocument::GetSdPageCount(), sd::ViewShellBase::GetViewShellBase(), Handout, sd::framework::FrameworkHelper::Instance(), maObjectIterator, mbMatchMayExist, mnPageCount, mpDrawDocument, mpImpl, mpWeakViewShell, sd::framework::FrameworkHelper::msCenterPaneURL, sd::framework::FrameworkHelper::msHandoutViewURL, sd::framework::FrameworkHelper::msImpressViewURL, sd::framework::FrameworkHelper::msNotesViewURL, Notes, PrepareSpelling(), SetViewShell(), and Standard.
Referenced by RestoreStartPosition(), and SetObject().
|
private |
Use this method when the view shell in which to search has changed.
It handles i.e. registering at the associated view as selection change listener.
Definition at line 1741 of file Outliner.cxx.
References getOutlinerView(), mpImpl, mpView, mpWeakViewShell, mpWindow, and OutlinerView::SetWindow().
Referenced by BeginConversion(), PrepareSpelling(), SetViewMode(), and StartSearchAndReplace().
|
private |
Show a dialog that tells the user that the search has ended either because there are no more matches after finding at least one or that no match has been found at all.
Definition at line 1395 of file Outliner.cxx.
References SdrMarkView::AreObjectsMarked(), Application::CreateMessageDialog(), GetMessageBoxParent(), SfxViewShell::libreOfficeKitViewCallback(), mbStringFound, meMode, mpSearchItem, mpView, mpWeakViewShell, SdResId(), SEARCH, and SvxSearchDialogWrapper::SetSearchLabel().
Referenced by EndOfSearch().
|
private |
Show a dialog that asks the user whether to wrap around to the beginning/end of the document and continue with the search/spell check.
Definition at line 1427 of file Outliner.cxx.
References Application::CreateMessageDialog(), SdDrawDocument::GetDocumentType(), GetMessageBoxParent(), Impress, mbDirectionIsForward, meMode, mpDrawDocument, mpSearchItem, RET_YES, SdResId(), SvxSearchDialogWrapper::SetSearchLabel(), and SPELL.
Referenced by EndOfSearch(), and HandleFailedSearch().
|
overrideprivatevirtual |
Initiate the spell check of the next relevant text object.
When the outline view is active then this method is called after a wrap around to continue at the beginning of the document.
Definition at line 344 of file Outliner.cxx.
References EndOfSearch(), SdDrawDocument::GetDocSh(), getOutlinerView(), Initialize(), mbEndOfSearch, mpDrawDocument, mpView, mpWeakViewShell, mpWindow, ProvideNextTextObject(), and OutlinerView::SetWindow().
Referenced by GetNextSpellSentence().
void SdOutliner::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.
Definition at line 1792 of file Outliner.cxx.
References BeginConversion(), EndConversion(), GetMessageBoxParent(), getOutlinerView(), mbDirectionIsForward, meMode, mnConversionLanguage, mpSearchItem, mpWeakViewShell, OutlinerView::StartTextConversion(), and TEXT_CONVERSION.
Referenced by sd::FuHangulHanjaConversion::StartConversion().
bool SdOutliner::StartSearchAndReplace | ( | const SvxSearchItem * | pSearchItem | ) |
Initiate a find and/or replace on the next relevant text object.
Go to next match.
Definition at line 420 of file Outliner.cxx.
References SvxSearchItem::Clone(), EndSpelling(), SvxSearchItem::GetCommand(), SdDrawDocument::GetDocSh(), sd::ViewShellBase::GetMainViewShell(), Initialize(), mbFoundObject, mbPrepareSpellingPending, mbStringFound, meMode, mnStartPageIndex, mpDrawDocument, mpSearchItem, mpWeakViewShell, PrepareSpelling(), RememberStartPosition(), RestoreStartPosition(), SEARCH, SearchAndReplaceAll(), SearchAndReplaceOnce(), SvxSearchDialogWrapper::SetSearchLabel(), SetViewShell(), sd::ViewShell::ST_DRAW, sd::ViewShell::ST_HANDOUT, sd::ViewShell::ST_IMPRESS, sd::ViewShell::ST_NOTES, and sd::ViewShell::ST_OUTLINE.
Referenced by sd::FuSearch::SearchAndReplace().
void SdOutliner::StartSpelling | ( | ) |
Initialize a spell check but do not start it yet.
This method is a better candidate for the name PrepareSpelling.
Definition at line 271 of file Outliner.cxx.
References mbDirectionIsForward, meMode, mpSearchItem, and SPELL.
|
friend |
Definition at line 125 of file Outliner.hxx.
|
private |
The current position of the object iterator.
Definition at line 325 of file Outliner.hxx.
Referenced by DetectChange(), Initialize(), PrepareSearchAndReplace(), ProvideNextTextObject(), PutTextIntoOutliner(), SearchAndReplaceOnce(), and sendLOKSearchResultCallback().
|
private |
The last valid position describes where the last text object has been found.
This position is restored when some dialogs are shown. The position is initially set to the where the search begins.
Definition at line 333 of file Outliner.hxx.
Referenced by EndOfSearch(), Initialize(), and SearchAndReplaceOnce().
|
private |
When the search is restricted to the current selection then this list contains pointers to all the objects of the selection.
This copy is necessary because during the search process the mark list is modified.
Definition at line 275 of file Outliner.hxx.
Referenced by sd::outliner::OutlinerContainer::CreateIterator(), and HandleChangedSelection().
|
private |
The actual object iterator.
Definition at line 323 of file Outliner.hxx.
Referenced by BeginConversion(), DetectChange(), EndOfSearch(), Initialize(), PrepareSpellCheck(), PrepareSpelling(), ProvideNextTextObject(), SearchAndReplaceAll(), SearchAndReplaceOnce(), and SetViewMode().
|
private |
The position when the search started.
Corresponds largely to the m?Start* members.
Definition at line 328 of file Outliner.hxx.
Referenced by BeginConversion(), PrepareSpellCheck(), and PrepareSpelling().
|
private |
The position of the caret when searching /spell checking was started.
Definition at line 314 of file Outliner.hxx.
Referenced by GetNextSpellSentence(), RememberStartPosition(), and RestoreStartPosition().
|
private |
This flag indicates whether to search forward or backwards.
Definition at line 263 of file Outliner.hxx.
Referenced by sd::outliner::OutlinerContainer::CreateIterator(), GetSearchStartPosition(), Initialize(), ShowWrapAroundDialog(), StartConversion(), and StartSpelling().
|
private |
A <TRUE> value indicates that the end of the find&replace or spell check has been reached.
Definition at line 253 of file Outliner.hxx.
Referenced by ConvertNextDocument(), EndOfSearch(), PrepareSpellCheck(), ProvideNextTextObject(), SearchAndReplaceOnce(), and SpellNextDocument().
|
private |
Set to <TRUE> when an object has been prepared successfully for searching/spell checking.
This flag directs the internal iteration which stops when set to </sal_True>.
Definition at line 259 of file Outliner.hxx.
Referenced by EnterEditMode(), ProvideNextTextObject(), and StartSearchAndReplace().
|
private |
This flag indicates whether there may exist a match of the search string before/after the current position in the document.
It can be set to </sal_False> only when starting from the beginning/end of the document. When reaching the end/beginning with it still be set to </sal_False> then there exists no match and the search can be terminated.
Definition at line 245 of file Outliner.hxx.
Referenced by BeginConversion(), EndOfSearch(), GetNextSpellSentence(), Initialize(), PrepareConversion(), PrepareSearchAndReplace(), PrepareSpelling(), ProvideNextTextObject(), and SetViewMode().
|
private |
When this flag is true then a PrepareSpelling() is executed when StartSearchAndReplace() is called the next time.
Definition at line 338 of file Outliner.hxx.
Referenced by PrepareSpelling(), and StartSearchAndReplace().
|
private |
This flag indicates that only the selected objects are to be searched.
Definition at line 268 of file Outliner.hxx.
Referenced by sd::outliner::OutlinerContainer::CreateIterator(), DetectSelectionChange(), EndOfSearch(), HandleChangedSelection(), and SetPage().
|
private |
Specifies whether the search string has been found so far.
Definition at line 237 of file Outliner.hxx.
Referenced by BeginConversion(), PrepareConversion(), PrepareSearchAndReplace(), PrepareSpelling(), ProvideNextTextObject(), SearchAndReplaceAll(), SearchAndReplaceOnce(), ShowEndOfSearchDialog(), and StartSearchAndReplace().
|
private |
|
private |
The master page mode that was active when starting to search/spell check.
Definition at line 304 of file Outliner.hxx.
Referenced by RememberStartPosition(), and RestoreStartPosition().
|
private |
The view mode that was active when starting to search/spell check.
Definition at line 301 of file Outliner.hxx.
Referenced by RememberStartPosition(), and RestoreStartPosition().
|
private |
this is the language that is used for current text conversion.
Only valid if meMode is TEXT_CONVERSION.
Definition at line 229 of file Outliner.hxx.
Referenced by PrepareConversion(), and StartConversion().
|
private |
While the value of this flag is greater than 0 changes of the current page do not lead to selecting the corresponding text in the outliner.
Definition at line 234 of file Outliner.hxx.
Referenced by DecreIgnoreCurrentPageChangesLevel(), GetIgnoreCurrentPageChangesLevel(), and IncreIgnoreCurrentPageChangesLevel().
|
private |
The number of pages in the current view.
Definition at line 248 of file Outliner.hxx.
Referenced by DetectChange(), and SetViewMode().
|
private |
The current page index on starting to search/spell check.
Definition at line 307 of file Outliner.hxx.
Referenced by EndSpelling(), RememberStartPosition(), RestoreStartPosition(), SearchAndReplaceAll(), and StartSearchAndReplace().
|
private |
Current text to be searched/spelled inside the current text object.
Definition at line 295 of file Outliner.hxx.
Referenced by ConvertNextDocument(), EnterEditMode(), and SetObject().
|
private |
The document on whose objects and pages this class operates.
Definition at line 224 of file Outliner.hxx.
Referenced by ConvertNextDocument(), sd::outliner::OutlinerContainer::CreateIterator(), DetectChange(), EndSpelling(), GetDoc(), PrepareConversion(), PrepareSearchAndReplace(), ProvideNextTextObject(), SdOutliner(), SearchAndReplaceOnce(), SetViewMode(), ShowWrapAroundDialog(), SpellNextDocument(), and StartSearchAndReplace().
|
private |
this stores the first object that is used for text conversion.
Conversion automatically wraps around the document and stops when it finds this object again.
Definition at line 289 of file Outliner.hxx.
Referenced by ConvertNextDocument().
|
private |
Definition at line 200 of file Outliner.hxx.
Referenced by BeginConversion(), EndSpelling(), getOutlinerView(), PrepareSpelling(), ProvideNextTextObject(), SearchAndReplaceOnce(), sendLOKSearchResultCallback(), SetViewMode(), and SetViewShell().
|
private |
Current object that may be a text object.
The object pointer to corresponds to <member>mnObjIndex</member>. While iterating over the objects on a page <member>mpObj</member> will point to every object while <member>mpTextObj</member> will be set only to valid text objects.
Definition at line 283 of file Outliner.hxx.
Referenced by ConvertNextDocument(), DetectSelectionChange(), PrepareSearchAndReplace(), ProvideNextTextObject(), PutTextIntoOutliner(), RestoreStartPosition(), SearchAndReplaceOnce(), and sendLOKSearchResultCallback().
|
private |
Paragraph object of <member>mpTextObj</member>.
Definition at line 298 of file Outliner.hxx.
Referenced by ProvideNextTextObject(), and PutTextIntoOutliner().
|
private |
The search item contains various attributes that define the type of search.
It is set every time the <member>SearchAndReplaceAll</member> method is called.
Definition at line 320 of file Outliner.hxx.
Referenced by HandleFailedSearch(), PrepareSearchAndReplace(), ProvideNextTextObject(), SearchAndReplaceAll(), SearchAndReplaceOnce(), sendLOKSearchResultCallback(), ShowEndOfSearchDialog(), ShowWrapAroundDialog(), StartConversion(), StartSearchAndReplace(), and StartSpelling().
|
private |
Candidate for being searched/spell checked.
Definition at line 292 of file Outliner.hxx.
Referenced by EnterEditMode(), ProvideNextTextObject(), and PutTextIntoOutliner().
|
private |
The object in edit mode when searching /spell checking was started (if any).
Definition at line 311 of file Outliner.hxx.
Referenced by RememberStartPosition(), and RestoreStartPosition().
|
private |
The view which displays the searched objects.
Definition at line 215 of file Outliner.hxx.
Referenced by DetectChange(), DetectSelectionChange(), EndSpelling(), EnterEditMode(), HandleChangedSelection(), ProvideNextTextObject(), RememberStartPosition(), SearchAndReplaceOnce(), SetViewShell(), ShowEndOfSearchDialog(), and SpellNextDocument().
|
private |
The view shell containing the view.
It is held as weak pointer to avoid keeping it alive when the view is changed during searching.
Definition at line 220 of file Outliner.hxx.
Referenced by BeginConversion(), ConvertNextDocument(), sd::outliner::OutlinerContainer::CreateIterator(), DetectChange(), EndOfSearch(), EndSpelling(), EnterEditMode(), GetMessageBoxParent(), Initialize(), PrepareSpelling(), ProvideNextTextObject(), RememberStartPosition(), RestoreStartPosition(), SearchAndReplaceAll(), SearchAndReplaceOnce(), SetPage(), SetViewMode(), SetViewShell(), ShowEndOfSearchDialog(), SpellNextDocument(), StartConversion(), and StartSearchAndReplace().
|
private |
This window contains the view.
Definition at line 222 of file Outliner.hxx.
Referenced by BeginConversion(), ConvertNextDocument(), EndSpelling(), EnterEditMode(), PrepareSpelling(), SearchAndReplaceOnce(), SetViewShell(), and SpellNextDocument().