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))
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 :
ESelection GetSelection() const
void SetSelection(const ESelection &rNewSel)
void InsertField(const SvxFieldItem &rFld)
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.
static SC_DLLPUBLIC void SetSearchItem(const SvxSearchItem &rNew)
static SC_DLLPUBLIC const SvxSearchItem & GetSearchItem()
ScRefCellValue * GetNext(SCCOL &rCol, SCROW &rRow)
bool ExportString(OUString &, SotClipboardFormatId)
ScInputHandler * GetInputHdl(ScTabViewShell *pViewSh=nullptr, bool bUseRef=true)
Input-Handler.
void SetInputMode(ScInputMode eMode, const OUString *pInitText=nullptr)
void GetVars(SCCOL &nCol1, SCROW &nRow1, SCTAB &nTab1, SCCOL &nCol2, SCROW &nRow2, SCTAB &nTab2) const
void ExecSearch(SfxRequest &rReq)
void InsertURLField(const OUString &rName, const OUString &rURL, const OUString &rTarget)
void InsertURLButton(const OUString &rName, const OUString &rURL, const OUString &rTarget, const Point *pInsPos)
void InsertURL(const OUString &rName, const OUString &rURL, const OUString &rTarget, sal_uInt16 nMode)
SfxShell * GetMySubShell() const
bool ShouldDisableEditHyperlink() const
return true if "Edit Hyperlink" in context menu should be disabled
virtual OUString GetSelectionText(bool bWholeWord=false, bool bOnlyASample=false) override
void EnableEditHyperlink()
force "Edit Hyperlink" to true, with the expectation that SID_EDIT_HYPERLINK is later Invalidated to ...
std::unique_ptr< ScEditShell > pEditShell
ScViewData & GetViewData()
SfxDispatcher & GetDispatcher()
ScDocument & GetDocument() const
ScTabViewShell * GetViewShell() const
bool SelectionEditable(bool *pOnlyNotBecauseOfMatrix=nullptr)
bool HasBookmarkAtCursor(SvxHyperlinkItem *pContent)
bool SearchAndReplace(const SvxSearchItem *pSearchItem, bool bAddUndo, bool bIsApi)
void InsertBookmark(const OUString &rDescription, const OUString &rURL, SCCOL nPosX, SCROW nPosY, const OUString *pTarget=nullptr, bool bTryReplace=false)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
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 * >())
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetWhich(sal_uInt16 nId)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
void Done(bool bRemove=false)
void SetReplaceString(const OUString &rNewString)
void SetCommand(SvxSearchCmd nNewCommand)
void SetSearchString(const OUString &rNewString)
void SetTargetFrame(const OUString &rFrm)
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
OString stripEnd(const OString &rIn, char c)
static void lcl_SelectFieldAfterInsert(EditView &rView)