23 #include <osl/diagnose.h>
40 #include <document.hxx>
44 OUString aStrSelection;
48 aStrSelection =
pEditShell->GetSelectionText( bWholeWord );
66 if ( aIter.GetNext( nCol, nRow ) )
82 aRange.
GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
97 OUString aExportOUString;
99 aObj.
ExportString( aExportOUString, SotClipboardFormatId::STRING );
109 aStrSelection = aStrSelection.replaceAll(
"\r",
" ");
110 aStrSelection = aStrSelection.replaceAll(
"\t",
" ");
116 return aStrSelection;
125 bRet =
pEditShell->ShouldDisableEditHyperlink();
167 SC_MOD()->InputEnterHandler();
186 SvxURLField aURLField( rURL, rName, SvxURLFormat::Repr );
194 bool bSelectFirst =
false;
214 OSL_ENSURE( pTopView || pTableView,
"No EditView" );
219 if (!bIsEditMode && !bSelectFirst && pTableView && !sSeltext.isEmpty())
221 nSelInd = sSeltext.getLength();
252 sal_uInt16 nSlot = rReq.
GetSlot();
261 (pSearchItem = pReqArgs->
GetItemIfSet(SID_SEARCH_ITEM,
false)) )
270 case SID_SEARCH_ITEM:
273 if (pReqArgs && (pSearchItem =
281 OSL_FAIL(
"SID_SEARCH_ITEM without Parameter");
287 case FID_REPLACE_ALL:
290 if (pReqArgs && SfxItemState::SET == pReqArgs->
GetItemState(nSlot,
false, &pItem))
299 if(SfxItemState::SET == pReqArgs->
GetItemState(FN_PARAM_1,
false, &pItem))
300 aSearchItem.
SetReplaceString(static_cast<const SfxStringItem*>(pItem)->GetValue());
302 if (nSlot == FID_SEARCH)
304 else if(nSlot == FID_REPLACE)
305 aSearchItem.
SetCommand(SvxSearchCmd::REPLACE);
306 else if(nSlot == FID_REPLACE_ALL)
307 aSearchItem.
SetCommand(SvxSearchCmd::REPLACE_ALL);
309 aSearchItem.
SetCommand(SvxSearchCmd::FIND_ALL);
313 aSearchItem.
SetWhich(SID_SEARCH_ITEM);
315 rReq.
IsAPI() ? SfxCallMode::API|SfxCallMode::SYNCHRON :
322 SID_SEARCH_DLG, SfxCallMode::ASYNCHRON|SfxCallMode::RECORD );
326 case FID_REPEAT_SEARCH:
331 aSearchItem.
SetWhich(SID_SEARCH_ITEM);
333 rReq.
IsAPI() ? SfxCallMode::API|SfxCallMode::SYNCHRON :
OString stripEnd(const OString &rIn, char c)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
void SetTargetFrame(const OUString &rFrm)
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
bool ExportString(OUString &, SotClipboardFormatId)
void SetSearchString(const OUString &rNewString)
void EnableEditHyperlink()
force "Edit Hyperlink" to true, with the expectation that SID_EDIT_HYPERLINK is later Invalidated to ...
void Done(bool bRemove=false)
ScDocument & GetDocument() const
static void lcl_SelectFieldAfterInsert(EditView &rView)
const SfxItemSet * GetArgs() const
void SetReplaceString(const OUString &rNewString)
std::unique_ptr< ScEditShell > pEditShell
bool SelectionEditable(bool *pOnlyNotBecauseOfMatrix=nullptr)
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
virtual OUString GetSelectionText(bool bWholeWord=false) override
bool HasBookmarkAtCursor(SvxHyperlinkItem *pContent)
bool SearchAndReplace(const SvxSearchItem *pSearchItem, bool bAddUndo, bool bIsApi)
static SC_DLLPUBLIC void SetSearchItem(const SvxSearchItem &rNew)
ScViewData & GetViewData()
bool ShrinkToUsedDataArea(bool &o_bShrunk, SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow, bool bColumnsOnly, bool bStickyTopRow=false, bool bStickyLeftCol=false, ScDataAreaExtras *pDataAreaExtras=nullptr) const
Shrink a range to only include used data area.
ScTabViewShell * GetViewShell() const
void InsertField(const SvxFieldItem &rFld)
void InsertURL(const OUString &rName, const OUString &rURL, const OUString &rTarget, sal_uInt16 nMode)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void InsertBookmark(const OUString &rDescription, const OUString &rURL, SCCOL nPosX, SCROW nPosY, const OUString *pTarget=nullptr, bool bTryReplace=false)
void SetCommand(SvxSearchCmd nNewCommand)
void GetVars(SCCOL &nCol1, SCROW &nRow1, SCTAB &nTab1, SCCOL &nCol2, SCROW &nRow2, SCTAB &nTab2) const
void InsertURLField(const OUString &rName, const OUString &rURL, const OUString &rTarget)
void ExecSearch(SfxRequest &rReq)
void SetInputMode(ScInputMode eMode, const OUString *pInitText=nullptr)
sal_uInt16 GetSlot() const
SfxShell * GetMySubShell() const
void SetWhich(sal_uInt16 nId)
SfxDispatcher & GetDispatcher()
void SetSelection(const ESelection &rNewSel)
ESelection GetSelection() const
ScInputHandler * GetInputHdl(ScTabViewShell *pViewSh=nullptr, bool bUseRef=true)
Input-Handler.
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
bool ShouldDisableEditHyperlink() const
return true if "Edit Hyperlink" in context menu should be disabled
void InsertURLButton(const OUString &rName, const OUString &rURL, const OUString &rTarget, const Point *pInsPos)
static SC_DLLPUBLIC const SvxSearchItem & GetSearchItem()