Skip to content

Commit

Permalink
ADD getCommandValues .uno:CursorPosition [MACRO-1928] (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
chase authored May 1, 2024
2 parents 4abe3bc + a0727af commit f95fcdd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libreoffice-core/desktop/source/lib/init.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5884,6 +5884,16 @@ static char* getPageColor()
return leakyStrDup(defaultColorHex);
}

static char* getCursorPosition()
{
tools::JsonWriter aJson;
SfxViewShell* pViewShell = SfxViewShell::Current();
const int nViewId = sal_Int32(pViewShell->GetViewShellId());
std::optional<OString> payload = pViewShell->getLOKPayload(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, nViewId);
aJson.put("rect", payload.value_or(OString()));
return aJson.extractData();;
}


static char* getPageSize()
{
Expand Down Expand Up @@ -6703,6 +6713,10 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
{
return getPageColor();
}
else if (!strcmp(pCommand, ".uno:CursorPosition"))
{
return getCursorPosition();
}
else if (!strcmp(pCommand, ".uno:PageSize"))
{
return getPageSize();
Expand Down

0 comments on commit f95fcdd

Please sign in to comment.