[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 35 commits - chart2/source desktop/source editeng/source include/editeng include/LibreOfficeKit include/sfx2 include/svx include/vcl officecfg/registry sc/sdi sc/source sd/sdi sd/source sfx2/source svx/sdi sw/sdi sw/source vcl/inc vcl/source vcl/unx vcl/win
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Wed May 13 16:58:38 UTC 2020
chart2/source/controller/inc/CommandDispatchContainer.hxx | 2
chart2/source/controller/main/ChartController_Window.cxx | 47 +-
chart2/source/controller/main/ControllerCommandDispatch.hxx | 3
desktop/source/lib/init.cxx | 14
editeng/source/editeng/editview.cxx | 54 ++
include/LibreOfficeKit/LibreOfficeKitEnums.h | 1
include/editeng/editview.hxx | 1
include/sfx2/dispatch.hxx | 4
include/sfx2/viewfrm.hxx | 2
include/svx/svxids.hrc | 3
include/vcl/svapp.hxx | 6
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 15
sc/sdi/docsh.sdi | 2
sc/source/ui/docshell/docsh4.cxx | 101 ++++
sd/sdi/_docsh.sdi | 12
sd/source/ui/docshell/docshel3.cxx | 106 ++++-
sfx2/source/control/dispatch.cxx | 189 ++++-----
sfx2/source/control/unoctitm.cxx | 12
sfx2/source/view/viewfrm.cxx | 6
svx/sdi/svx.sdi | 51 ++
sw/sdi/_textsh.sdi | 18
sw/source/core/edit/edlingu.cxx | 10
sw/source/uibase/inc/olmenu.hxx | 4
sw/source/uibase/inc/textsh.hxx | 2
sw/source/uibase/lingu/olmenu.cxx | 209 +++++-----
sw/source/uibase/shells/textsh1.cxx | 151 +++++++
sw/source/uibase/uiview/viewling.cxx | 23 -
vcl/inc/helpwin.hxx | 2
vcl/inc/svdata.hxx | 5
vcl/source/app/help.cxx | 88 ++--
vcl/source/app/svdata.cxx | 81 +++
vcl/source/window/floatwin.cxx | 13
vcl/source/window/window.cxx | 2
vcl/source/window/winproc.cxx | 63 +--
vcl/unx/gtk3/gtk3gtkinst.cxx | 8
vcl/win/window/salframe.cxx | 2
36 files changed, 992 insertions(+), 320 deletions(-)
New commits:
commit 89a9f0b9222b7362e3f3c82636d8d60ea1a886f9
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Apr 7 10:31:51 2020 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:54:39 2020 +0200
lok: Use a different window type for tooltips.
Change-Id: I211cd6bc2249475dbacd80f944e22465b19aff77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91829
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 829eca07e500..69cee90893db 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -609,6 +609,7 @@ typedef enum
* - "dialog" - window is a dialog
* - "child" - window is a floating window (combo boxes, etc.)
* - "deck" - window is a docked/floating deck (i.e. the sidebar)
+ * - "tooltip" - window is a tooltip popup
*
* "action" can take following values:
* - "created" - window is created in the backend, client can render it now
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 672eb6236fee..40a0f1d3175d 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -21,6 +21,7 @@
#include <brdwin.hxx>
#include <window.h>
#include <salframe.hxx>
+#include <helpwin.hxx>
#include <comphelper/lok.hxx>
#include <sal/log.hxx>
@@ -649,7 +650,11 @@ void FloatingWindow::StateChanged( StateChangedType nType )
else
{
SetLOKNotifier(pParent->GetLOKNotifier());
- aItems.emplace_back("type", "child");
+ if (dynamic_cast<HelpTextWindow*>(this))
+ aItems.emplace_back("type", "tooltip");
+ else
+ aItems.emplace_back("type", "child");
+
aItems.emplace_back("parentId", OString::number(pParent->GetLOKWindowId()));
if (mbInPopupMode)
aItems.emplace_back("position", mpImplData->maPos.toString()); // pixels
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 190a0de4a717..16aec834ab5a 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -157,16 +157,6 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
static void ImplHandleMouseHelpRequest( vcl::Window* pChild, const Point& rMousePos )
{
- if (comphelper::LibreOfficeKit::isActive())
- {
- // Ignore tooltips in popup color palettes
- // (e.g. Character Properties dialog -> Font Effects -> Font Color)
- if(pChild->GetType() == WindowType::CONTROL &&
- pChild->GetParent() && pChild->GetParent()->GetParent() &&
- pChild->GetParent()->GetParent()->GetType() == WindowType::DOCKINGWINDOW)
- return;
- }
-
ImplSVHelpData& aHelpData = ImplGetSVHelpData();
if ( !aHelpData.mpHelpWin ||
!( aHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
commit c0c739a2d8179d1cb2c02a0ffec21fc2e3d7f879
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Mar 27 13:58:52 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:54:15 2020 +0200
sw lok: add uno command for submenus in Spellchecking popup.
Change-Id: I1c7591379ecbce0099ed7d969e5dc83831e322b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91227
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index 48c538a75a6a..cb14cd26aca7 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -619,6 +619,7 @@ void SwSpellPopup::InitItemCommands(const css::uno::Sequence< OUString >& aSugge
}
PopupMenu *pMenu = m_xPopupMenu->GetPopupMenu(m_nLangSelectionMenuId);
+ m_xPopupMenu->SetItemCommand(m_nLangSelectionMenuId, ".uno:SetSelectionLanguageMenu");
if(pMenu)
{
for (const auto& item : m_aLangTable_Text)
@@ -633,6 +634,7 @@ void SwSpellPopup::InitItemCommands(const css::uno::Sequence< OUString >& aSugge
}
pMenu = m_xPopupMenu->GetPopupMenu(m_nLangParaMenuId);
+ m_xPopupMenu->SetItemCommand(m_nLangParaMenuId, ".uno:SetParagraphLanguageMenu");
if(pMenu)
{
for (const auto& item : m_aLangTable_Paragraph)
commit 259152f4b47fde78be50c284a9dd00ef2ddc4e0c
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 16 19:36:38 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:53:40 2020 +0200
sc lok: Implement execution of SID_SPELLCHECK_APPLY_SUGGESTION
Used by online spellchecking context menu.
Change-Id: Id065d366d5ef2ddb3ecf78d202a7264b6962ec8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90601
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sc/sdi/docsh.sdi b/sc/sdi/docsh.sdi
index 364bd3adaa69..99019d55ff6f 100644
--- a/sc/sdi/docsh.sdi
+++ b/sc/sdi/docsh.sdi
@@ -76,6 +76,7 @@ interface TableDocument
SID_NOTEBOOKBAR [ ExecMethod = Execute; StateMethod = GetState; ]
SID_LANGUAGE_STATUS [ ExecMethod = Execute; StateMethod = GetState; ]
SID_SPELLCHECK_IGNORE_ALL [ ExecMethod = Execute; StateMethod = GetState; ]
+ SID_SPELLCHECK_APPLY_SUGGESTION [ ExecMethod = Execute; StateMethod = GetState; ]
}
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index aa5986aaf397..913e97d857c4 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1306,6 +1306,30 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
}
break;
+ case SID_SPELLCHECK_APPLY_SUGGESTION:
+ {
+ ScViewData* pViewData = GetViewData();
+ if (!pViewData)
+ return;
+
+ EditView* pEditView = pViewData->GetEditView(pViewData->GetActivePart());
+ if (!pEditView)
+ return;
+
+ OUString sApplyText;
+ const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
+ if (pItem2)
+ sApplyText = pItem2->GetValue();
+
+ const OUString sSpellingRule("Spelling_");
+ sal_Int32 nPos = 0;
+ if(-1 != (nPos = sApplyText.indexOf( sSpellingRule )))
+ {
+ sApplyText = sApplyText.replaceAt(nPos, sSpellingRule.getLength(), "");
+ pEditView->InsertText( sApplyText );
+ }
+ }
+ break;
default:
{
// small (?) hack -> forwarding of the slots to TabViewShell
commit 612469458eb35307d1a61bda291f790a5e78addb
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 16 18:45:11 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:53:26 2020 +0200
sc lok: Implement execution of SID_LANGUAGE_STATUS...
Also for selection and paragraph which is used by the
spellchecking context menu.
Change-Id: I583caf48b9176ef4d6971cfe3b445080d01dc531
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90599
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index f79cdeccd5b4..aa5986aaf397 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -106,6 +106,8 @@ using namespace ::com::sun::star;
#include <memory>
#include <sfx2/notebookbar/SfxNotebookBar.hxx>
#include <helpids.h>
+#include <editeng/eeitem.hxx>
+#include <editeng/langitem.hxx>
#include <svx/xdef.hxx>
@@ -1167,10 +1169,15 @@ void ScDocShell::Execute( SfxRequest& rReq )
if ( !aLangText.isEmpty() )
{
LanguageType eLang, eLatin, eCjk, eCtl;
+ const OUString aSelectionLangPrefix("Current_");
+ const OUString aParagraphLangPrefix("Paragraph_");
const OUString aDocLangPrefix("Default_");
const OUString aNoLang("LANGUAGE_NONE");
const OUString aResetLang("RESET_LANGUAGES");
+ bool bSelection = false;
+ bool bParagraph = false;
+
ScDocument& rDoc = GetDocument();
rDoc.GetLanguage( eLatin, eCjk, eCtl );
@@ -1212,8 +1219,52 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
}
}
+ else if (-1 != (nPos = aLangText.indexOf( aSelectionLangPrefix )))
+ {
+ bSelection = true;
+ aLangText = aLangText.replaceAt( nPos, aSelectionLangPrefix.getLength(), "" );
+ }
+ else if (-1 != (nPos = aLangText.indexOf( aParagraphLangPrefix )))
+ {
+ bParagraph = true;
+ aLangText = aLangText.replaceAt( nPos, aParagraphLangPrefix.getLength(), "" );
+ }
- if ( eLang != eLatin )
+ if (bSelection || bParagraph)
+ {
+ ScViewData* pViewData = GetViewData();
+ if (!pViewData)
+ return;
+
+ EditView* pEditView = pViewData->GetEditView(pViewData->GetActivePart());
+ if (!pEditView)
+ return;
+
+ const LanguageType nLangToUse = SvtLanguageTable::GetLanguageType( aLangText );
+ SvtScriptType nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nLangToUse );
+
+ SfxItemSet aAttrs = pEditView->GetEditEngine()->GetEmptyItemSet();
+ if (nScriptType == SvtScriptType::LATIN)
+ aAttrs.Put( SvxLanguageItem( nLangToUse, EE_CHAR_LANGUAGE ) );
+ if (nScriptType == SvtScriptType::COMPLEX)
+ aAttrs.Put( SvxLanguageItem( nLangToUse, EE_CHAR_LANGUAGE_CTL ) );
+ if (nScriptType == SvtScriptType::ASIAN)
+ aAttrs.Put( SvxLanguageItem( nLangToUse, EE_CHAR_LANGUAGE_CJK ) );
+ ESelection aOldSel;
+ if (bParagraph)
+ {
+ ESelection aSel = pEditView->GetSelection();
+ aOldSel = aSel;
+ aSel.nStartPos = 0;
+ aSel.nEndPos = EE_TEXTPOS_ALL;
+ pEditView->SetSelection( aSel );
+ }
+
+ pEditView->SetAttribs( aAttrs );
+ if (bParagraph)
+ pEditView->SetSelection( aOldSel );
+ }
+ else if ( eLang != eLatin )
{
if ( ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell() )
{
commit cca5e817833156b9c94b7a71b231a0819bd1334d
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 16 17:20:22 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:53:13 2020 +0200
sd lok: Implement execution of SID_SPELLCHECK_APPLY_SUGGESTION
Used by online spellchecking context menu.
Change-Id: I9d7430b4ef45af1641fc985cf4588d45ba497ee9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90598
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sd/sdi/_docsh.sdi b/sd/sdi/_docsh.sdi
index 8644b752702c..02de70858ab0 100644
--- a/sd/sdi/_docsh.sdi
+++ b/sd/sdi/_docsh.sdi
@@ -83,5 +83,11 @@ interface DrawDocument
ExecMethod = Execute ;
StateMethod = GetState ;
]
+
+ SID_SPELLCHECK_APPLY_SUGGESTION
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
}
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index 12d0d86773c5..9d8ce84cb538 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -381,6 +381,27 @@ void DrawDocShell::Execute( SfxRequest& rReq )
}
}
break;
+ case SID_SPELLCHECK_APPLY_SUGGESTION:
+ {
+ SdrView* pSdrView = mpViewShell->GetDrawView();
+ if (!pSdrView)
+ return;
+
+ EditView& rEditView = pSdrView->GetTextEditOutlinerView()->GetEditView();
+ OUString sApplyText;
+ const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
+ if (pItem2)
+ sApplyText = pItem2->GetValue();
+
+ const OUString sSpellingRule("Spelling_");
+ sal_Int32 nPos = 0;
+ if(-1 != (nPos = sApplyText.indexOf( sSpellingRule )))
+ {
+ sApplyText = sApplyText.replaceAt(nPos, sSpellingRule.getLength(), "");
+ rEditView.InsertText( sApplyText );
+ }
+ }
+ break;
case SID_NOTEBOOKBAR:
{
commit 69544a8e8ef76873626f2fc5d3eade21faf56b35
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 16 17:14:33 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:53:03 2020 +0200
sd lok: Implement execution of SID_SPELLCHECK_IGNORE_ALL
Used by online spellchecking context menu.
Change-Id: Iad3dafedbfed1605ba06f7f87ed91117c9b1a8e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90597
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index bc339115d790..8c7ab6058e8e 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1195,6 +1195,11 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
}
}
+OUString EditView::SpellIgnoreWord()
+{
+ return pImpEditView->SpellIgnoreWord();
+}
+
void EditView::SelectCurrentWord( sal_Int16 nWordType )
{
EditSelection aCurSel( pImpEditView->GetEditSelection() );
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 6fb972182357..fdbfd8a08fff 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -270,6 +270,7 @@ public:
bool IsCursorAtWrongSpelledWord();
bool IsWrongSpelledWordAtPos( const Point& rPosPixel, bool bMarkIfWrong = false );
void ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo&,void> const * pCallBack );
+ OUString SpellIgnoreWord();
void InsertField( const SvxFieldItem& rFld );
const SvxFieldItem* GetFieldUnderMousePointer() const;
diff --git a/sd/sdi/_docsh.sdi b/sd/sdi/_docsh.sdi
index 29db81db02d2..8644b752702c 100644
--- a/sd/sdi/_docsh.sdi
+++ b/sd/sdi/_docsh.sdi
@@ -77,5 +77,11 @@ interface DrawDocument
ExecMethod = Execute;
StateMethod = GetState;
]
+
+ SID_SPELLCHECK_IGNORE_ALL
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
}
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index 62f365cadbea..12d0d86773c5 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -360,6 +360,27 @@ void DrawDocShell::Execute( SfxRequest& rReq )
Broadcast(SfxHint(SfxHintId::LanguageChanged));
}
break;
+ case SID_SPELLCHECK_IGNORE_ALL:
+ {
+ SdrView* pSdrView = mpViewShell->GetDrawView();
+ if (!pSdrView)
+ return;
+
+ EditView& rEditView = pSdrView->GetTextEditOutlinerView()->GetEditView();
+ OUString sIgnoreText;
+ const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
+ if (pItem2)
+ sIgnoreText = pItem2->GetValue();
+
+ const OUString sSpellingType("Spelling");
+ if(sIgnoreText == sSpellingType)
+ {
+ ESelection aOldSel = rEditView.GetSelection();
+ rEditView.SpellIgnoreWord();
+ rEditView.SetSelection( aOldSel );
+ }
+ }
+ break;
case SID_NOTEBOOKBAR:
{
commit aac0e8e7553236fc2ba87431834cfeb2ef46fb5c
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 16 19:16:19 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:52:48 2020 +0200
sc lok: Implement execution of SID_SPELLCHECK_IGNORE_ALL
Used by online spellchecking context menu.
Change-Id: I31779a38f467838d3719a0d32cbf37e335432d38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90600
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sc/sdi/docsh.sdi b/sc/sdi/docsh.sdi
index fdb22acf3e0c..364bd3adaa69 100644
--- a/sc/sdi/docsh.sdi
+++ b/sc/sdi/docsh.sdi
@@ -75,6 +75,7 @@ interface TableDocument
SID_SHARE_DOC [ ExecMethod = Execute; StateMethod = GetState; ]
SID_NOTEBOOKBAR [ ExecMethod = Execute; StateMethod = GetState; ]
SID_LANGUAGE_STATUS [ ExecMethod = Execute; StateMethod = GetState; ]
+ SID_SPELLCHECK_IGNORE_ALL [ ExecMethod = Execute; StateMethod = GetState; ]
}
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 9c04bae44b0f..f79cdeccd5b4 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1231,6 +1231,30 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
}
break;
+ case SID_SPELLCHECK_IGNORE_ALL:
+ {
+ ScViewData* pViewData = GetViewData();
+ if (!pViewData)
+ return;
+
+ EditView* pEditView = pViewData->GetEditView(pViewData->GetActivePart());
+ if (!pEditView)
+ return;
+
+ OUString sIgnoreText;
+ const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
+ if (pItem2)
+ sIgnoreText = pItem2->GetValue();
+
+ const OUString sSpellingType("Spelling");
+ if(sIgnoreText == sSpellingType)
+ {
+ ESelection aOldSel = pEditView->GetSelection();
+ pEditView->SpellIgnoreWord();
+ pEditView->SetSelection( aOldSel );
+ }
+ }
+ break;
default:
{
// small (?) hack -> forwarding of the slots to TabViewShell
commit 6b578ddb7049e19afd02d13bd7fd670cde139f63
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 16 16:24:48 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:52:33 2020 +0200
sd lok: Implement execution of SID_LANGUAGE_STATUS...
Also for selection and paragraph which is used by the
spellchecking context menu.
Change-Id: Ie242175605185b3083aa529b54acc183aee1d47b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90596
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index 54791875a733..62f365cadbea 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -38,6 +38,8 @@
#include <editeng/editobj.hxx>
#include <com/sun/star/i18n/TextConversionOption.hpp>
#include <sfx2/notebookbar/SfxNotebookBar.hxx>
+#include <drawview.hxx>
+#include <editeng/editeng.hxx>
#include <sdmod.hxx>
#include <drawdoc.hxx>
@@ -265,6 +267,7 @@ void DrawDocShell::Execute( SfxRequest& rReq )
const SfxStringItem* pItem = rReq.GetArg<SfxStringItem>(SID_LANGUAGE_STATUS);
if (pItem)
aNewLangTxt = pItem->GetValue();
+
if (aNewLangTxt == "*" )
{
// open the dialog "Tools/Options/Language Settings - Language"
@@ -282,25 +285,70 @@ void DrawDocShell::Execute( SfxRequest& rReq )
// setting the new language...
if (!aNewLangTxt.isEmpty())
{
+ const OUString aSelectionLangPrefix("Current_");
+ const OUString aParagraphLangPrefix("Paragraph_");
const OUString aDocumentLangPrefix("Default_");
const OUString aStrNone("LANGUAGE_NONE");
const OUString aStrResetLangs("RESET_LANGUAGES");
+
+ bool bSelection = false;
+ bool bParagraph = false;
+
SdDrawDocument* pDoc = mpViewShell->GetDoc();
sal_Int32 nPos = -1;
if (-1 != (nPos = aNewLangTxt.indexOf( aDocumentLangPrefix )))
{
aNewLangTxt = aNewLangTxt.replaceAt( nPos, aDocumentLangPrefix.getLength(), "" );
+
+ if (aNewLangTxt == aStrNone)
+ lcl_setLanguage( pDoc, OUString(), true );
+ else if (aNewLangTxt == aStrResetLangs)
+ lcl_setLanguage( pDoc, OUString() );
+ else
+ lcl_setLanguage( pDoc, aNewLangTxt );
}
- else
+ else if (-1 != (nPos = aNewLangTxt.indexOf( aSelectionLangPrefix )))
+ {
+ bSelection = true;
+ aNewLangTxt = aNewLangTxt.replaceAt( nPos, aSelectionLangPrefix.getLength(), "" );
+ }
+ else if (-1 != (nPos = aNewLangTxt.indexOf( aParagraphLangPrefix )))
+ {
+ bParagraph = true;
+ aNewLangTxt = aNewLangTxt.replaceAt( nPos, aParagraphLangPrefix.getLength(), "" );
+ }
+
+ if (bSelection || bParagraph)
{
- break;
+ SdrView* pSdrView = mpViewShell->GetDrawView();
+ if (!pSdrView)
+ return;
+
+ EditView& rEditView = pSdrView->GetTextEditOutlinerView()->GetEditView();
+ const LanguageType nLangToUse = SvtLanguageTable::GetLanguageType( aNewLangTxt );
+ SvtScriptType nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nLangToUse );
+
+ SfxItemSet aAttrs = rEditView.GetEditEngine()->GetEmptyItemSet();
+ if (nScriptType == SvtScriptType::LATIN)
+ aAttrs.Put( SvxLanguageItem( nLangToUse, EE_CHAR_LANGUAGE ) );
+ if (nScriptType == SvtScriptType::COMPLEX)
+ aAttrs.Put( SvxLanguageItem( nLangToUse, EE_CHAR_LANGUAGE_CTL ) );
+ if (nScriptType == SvtScriptType::ASIAN)
+ aAttrs.Put( SvxLanguageItem( nLangToUse, EE_CHAR_LANGUAGE_CJK ) );
+ ESelection aOldSel;
+ if (bParagraph)
+ {
+ ESelection aSel = rEditView.GetSelection();
+ aOldSel = aSel;
+ aSel.nStartPos = 0;
+ aSel.nEndPos = EE_TEXTPOS_ALL;
+ rEditView.SetSelection( aSel );
+ }
+
+ rEditView.SetAttribs( aAttrs );
+ if (bParagraph)
+ rEditView.SetSelection( aOldSel );
}
- if (aNewLangTxt == aStrNone)
- lcl_setLanguage( pDoc, OUString(), true );
- else if (aNewLangTxt == aStrResetLangs)
- lcl_setLanguage( pDoc, OUString() );
- else
- lcl_setLanguage( pDoc, aNewLangTxt );
if ( pDoc->GetOnlineSpell() )
{
commit d1ea99306a17df5403be282a9f9afd57b03a2a70
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 16 15:49:29 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:51:55 2020 +0200
lok: Send spelling popup menu structure for mobile (calc and impress).
Similar to how writer behaves. Instead of using tunneling,
we send the menu structure with the commands.
By now this commands are not executed by the document shell
of calc / impress. I'll implement that in separate commits.
Change-Id: If342c83143a9a7c2ec74b99027f6d4ba8b44ef08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90595
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 9ada4292ba12..bc339115d790 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -69,6 +69,9 @@
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <comphelper/lok.hxx>
#include <sfx2/viewsh.hxx>
+#include <sfx2/lokhelper.hxx>
+#include <boost/property_tree/json_parser.hpp>
+#include <sfx2/dispatch.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -845,6 +848,41 @@ bool EditView::IsWrongSpelledWordAtPos( const Point& rPosPixel, bool bMarkIfWron
return pImpEditView->IsWrongSpelledWord( aPaM , bMarkIfWrong );
}
+static void LOKSendSpellPopupMenu(Menu* pMenu, LanguageType nGuessLangWord,
+ LanguageType nGuessLangPara, sal_uInt16 nSuggestions)
+{
+ if (!comphelper::LibreOfficeKit::isActive())
+ return;
+
+ // First we need to set item commends for the context menu.
+ OUString aTmpWord( SvtLanguageTable::GetLanguageString( nGuessLangWord ) );
+ OUString aTmpPara( SvtLanguageTable::GetLanguageString( nGuessLangPara ) );
+
+ pMenu->SetItemCommand(pMenu->GetItemId("ignore"), ".uno:SpellCheckIgnoreAll?Type:string=Spelling");
+ pMenu->SetItemCommand(MN_WORDLANGUAGE, ".uno:LanguageStatus?Language:string=Current_" + aTmpWord);
+ pMenu->SetItemCommand(MN_PARALANGUAGE, ".uno:LanguageStatus?Language:string=Paragraph_" + aTmpPara);
+
+ for(int i = 0; i < nSuggestions; ++i)
+ {
+ sal_uInt16 nItemId = MN_ALTSTART + i;
+ OUString sCommandString = ".uno:SpellCheckApplySuggestion?ApplyRule:string=Spelling_" + pMenu->GetItemText(nItemId);
+ pMenu->SetItemCommand(nItemId, sCommandString);
+ }
+
+ // Then we generate the menu structure and send it to the client code.
+ if (SfxViewShell* pViewShell = SfxViewShell::Current())
+ {
+ boost::property_tree::ptree aMenu = SfxDispatcher::fillPopupMenu(pMenu);
+ boost::property_tree::ptree aRoot;
+ aRoot.add_child("menu", aMenu);
+
+ std::stringstream aStream;
+ boost::property_tree::write_json(aStream, aRoot, true);
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU, aStream.str().c_str());
+ return;
+ }
+}
+
void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo&,void> const * pCallBack )
{
Point aPos ( pImpEditView->GetWindow()->PixelToLogic( rPosPixel ) );
@@ -1029,7 +1067,16 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
if (comphelper::LibreOfficeKit::isActive())
- aPopupMenu->SetLOKNotifier(SfxViewShell::Current());
+ {
+ // For mobile, send the context menu structure
+ if (comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+ {
+ LOKSendSpellPopupMenu(aPopupMenu, nGuessLangWord, nGuessLangPara, nWords);
+ return;
+ }
+ else // For desktop, we use the tunneled dialog
+ aPopupMenu->SetLOKNotifier(SfxViewShell::Current());
+ }
sal_uInt16 nId = aPopupMenu->Execute(pImpEditView->GetWindow(), aTempRect, PopupMenuFlags::NoMouseUpClose);
aPaM2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP2);
commit 2b83aba21948da7e7e8328eab61a096b2d94e2c4
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Feb 5 11:33:26 2020 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:48:56 2020 +0200
lok: writer: Convert row height / cloumn width to the correct unit.
In online, the mobile wizad displayed these attributes in the wrong
unit.
Change-Id: I165a8ee17bebbbfd8962ac9addc89df39c77851a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88004
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 4354a9a35e54..52339b8c7f5b 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1206,6 +1206,18 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c
}
}
}
+ else if (aEvent.FeatureURL.Path == "TableColumWidth" ||
+ aEvent.FeatureURL.Path == "TableRowHeight")
+ {
+ sal_Int32 nValue;
+ if (aEvent.State >>= nValue)
+ {
+ float nScaleValue = 1000.0;
+ nValue *= nScaleValue;
+ sal_Int32 nConvertedValue = OutputDevice::LogicToLogic(nValue, MapUnit::MapTwip, MapUnit::MapInch);
+ aBuffer.append(OUString::number(nConvertedValue / nScaleValue));
+ }
+ }
else
{
return;
commit 202018a41c14a65b57643af02b76e8356f47244b
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Jul 23 19:38:56 2019 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:48:37 2020 +0200
lok: Support per-view help data
Used for showing tooltip windows in LO online.
Change-Id: I8b6a7272c75025e717923c839fa8fd9f4cab2903
Reviewed-on: https://gerrit.libreoffice.org/84717
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/84803
Tested-by: Jenkins
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index fe336ba5f091..20bcc4904fcb 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -28,6 +28,7 @@
#include <sfx2/objsh.hxx>
#include <sfx2/shell.hxx>
#include <svl/poolitem.hxx>
+#include <vcl/svapp.hxx>
class Button;
class SvBorder;
@@ -48,6 +49,7 @@ class SFX2_DLLPUBLIC SfxViewFrame: public SfxShell, public SfxListener
SfxObjectShellRef m_xObjSh;
std::unique_ptr<SfxDispatcher> m_pDispatcher;
SfxBindings* m_pBindings;
+ ImplSVHelpData* m_pHelpData;
sal_uInt16 m_nAdjustPosPixelLock;
private:
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 16b8015b923a..95e46500a899 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1452,6 +1452,12 @@ VCL_DLLPUBLIC bool InitAccessBridge();
VCL_DLLPUBLIC void CreateMainLoopThread( oslWorkerFunction pWorker, void * pThreadData );
VCL_DLLPUBLIC void JoinMainLoopThread();
+/// The following are to manage per-view (frame) help data.
+struct ImplSVHelpData;
+VCL_DLLPUBLIC ImplSVHelpData* CreateSVHelpData();
+VCL_DLLPUBLIC void DestroySVHelpData(ImplSVHelpData*);
+VCL_DLLPUBLIC void SetSVHelpData(ImplSVHelpData*);
+
inline void Application::EndYield()
{
PostUserEvent( Link<void*,void>() );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index b64f68fe5a3c..7c0efa142fda 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1569,6 +1569,7 @@ SfxViewFrame::SfxViewFrame
)
: m_pImpl( new SfxViewFrame_Impl( rFrame ) )
, m_pBindings( new SfxBindings )
+ , m_pHelpData(CreateSVHelpData())
, m_nAdjustPosPixelLock( 0 )
{
@@ -1611,6 +1612,9 @@ SfxViewFrame::~SfxViewFrame()
// Delete Member
KillDispatcher_Impl();
+
+ DestroySVHelpData(m_pHelpData);
+ m_pHelpData = nullptr;
}
// Remove and delete the Dispatcher.
@@ -3242,6 +3246,8 @@ void SfxViewFrame::UpdateDocument_Impl()
void SfxViewFrame::SetViewFrame( SfxViewFrame* pFrame )
{
+ if(pFrame)
+ SetSVHelpData(pFrame->m_pHelpData);
SfxGetpApp()->SetViewFrame_Impl( pFrame );
}
diff --git a/vcl/inc/helpwin.hxx b/vcl/inc/helpwin.hxx
index 5d2e19e80654..fc5e14ffda02 100644
--- a/vcl/inc/helpwin.hxx
+++ b/vcl/inc/helpwin.hxx
@@ -24,6 +24,7 @@
#include <vcl/timer.hxx>
enum class QuickHelpFlags;
+struct ImplSVHelpData;
class HelpTextWindow : public FloatingWindow
{
@@ -73,6 +74,7 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe
const OUString& rHelpText,
const Point& rScreenPos, const tools::Rectangle& rHelpArea );
VCL_DLLPUBLIC void ImplDestroyHelpWindow( bool bUpdateHideTime );
+VCL_DLLPUBLIC void ImplDestroyHelpWindow(ImplSVHelpData& rHelpData, bool bUpdateHideTime);
void ImplSetHelpWindowPos( vcl::Window* pHelpWindow, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle,
const Point& rPos, const tools::Rectangle& rHelpArea );
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 654b9ec968f1..69fdcca77c46 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -369,6 +369,7 @@ struct ImplSchedulerContext
struct ImplSVData
{
+ ImplSVData();
~ImplSVData();
SalData* mpSalData = nullptr;
SalInstance* mpDefInst = nullptr; // Default SalInstance
@@ -386,7 +387,7 @@ struct ImplSVData
ImplSVGDIData maGDIData; // indepen data for Output classes
ImplSVWinData maWinData; // indepen data for Windows classes
ImplSVCtrlData maCtrlData; // indepen data for Control classes
- ImplSVHelpData maHelpData; // indepen data for Help classes
+ ImplSVHelpData* mpHelpData; // Data for Help classes
ImplSVNWFData maNWFData;
UnoWrapperBase* mpUnoWrapper = nullptr;
VclPtr<vcl::Window> mpIntroWindow; // the splash screen
@@ -422,6 +423,8 @@ VCL_PLUGIN_PUBLIC OUString VclResId(const char* pId);
DockingManager* ImplGetDockingManager();
BlendFrameCache* ImplGetBlendFrameCache();
+VCL_PLUGIN_PUBLIC ImplSVHelpData& ImplGetSVHelpData();
+
VCL_DLLPUBLIC bool ImplCallPreNotify( NotifyEvent& rEvt );
VCL_PLUGIN_PUBLIC ImplSVData* ImplGetSVData();
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 0176b8b895e0..f88c11f1f833 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -76,43 +76,44 @@ OUString Help::GetHelpText( const OUString&, const weld::Widget* )
void Help::EnableContextHelp()
{
- ImplGetSVData()->maHelpData.mbContextHelp = true;
+ ImplGetSVHelpData().mbContextHelp = true;
}
void Help::DisableContextHelp()
{
- ImplGetSVData()->maHelpData.mbContextHelp = false;
+ ImplGetSVHelpData().mbContextHelp = false;
}
bool Help::IsContextHelpEnabled()
{
- return ImplGetSVData()->maHelpData.mbContextHelp;
+ return ImplGetSVHelpData().mbContextHelp;
}
void Help::EnableExtHelp()
{
- ImplGetSVData()->maHelpData.mbExtHelp = true;
+ ImplGetSVHelpData().mbExtHelp = true;
}
void Help::DisableExtHelp()
{
- ImplGetSVData()->maHelpData.mbExtHelp = false;
+ ImplGetSVHelpData().mbExtHelp = false;
}
bool Help::IsExtHelpEnabled()
{
- return ImplGetSVData()->maHelpData.mbExtHelp;
+ return ImplGetSVHelpData().mbExtHelp;
}
bool Help::StartExtHelp()
{
ImplSVData* pSVData = ImplGetSVData();
+ ImplSVHelpData& aHelpData = ImplGetSVHelpData();
- if ( pSVData->maHelpData.mbExtHelp && !pSVData->maHelpData.mbExtHelpMode )
+ if ( aHelpData.mbExtHelp && !aHelpData.mbExtHelpMode )
{
- pSVData->maHelpData.mbExtHelpMode = true;
- pSVData->maHelpData.mbOldBalloonMode = pSVData->maHelpData.mbBalloonHelp;
- pSVData->maHelpData.mbBalloonHelp = true;
+ aHelpData.mbExtHelpMode = true;
+ aHelpData.mbOldBalloonMode = aHelpData.mbBalloonHelp;
+ aHelpData.mbBalloonHelp = true;
if ( pSVData->maWinData.mpAppWin )
pSVData->maWinData.mpAppWin->ImplGenerateMouseMove();
return true;
@@ -124,11 +125,12 @@ bool Help::StartExtHelp()
bool Help::EndExtHelp()
{
ImplSVData* pSVData = ImplGetSVData();
+ ImplSVHelpData& aHelpData = ImplGetSVHelpData();
- if ( pSVData->maHelpData.mbExtHelp && pSVData->maHelpData.mbExtHelpMode )
+ if ( aHelpData.mbExtHelp && aHelpData.mbExtHelpMode )
{
- pSVData->maHelpData.mbExtHelpMode = false;
- pSVData->maHelpData.mbBalloonHelp = pSVData->maHelpData.mbOldBalloonMode;
+ aHelpData.mbExtHelpMode = false;
+ aHelpData.mbBalloonHelp = aHelpData.mbOldBalloonMode;
if ( pSVData->maWinData.mpAppWin )
pSVData->maWinData.mpAppWin->ImplGenerateMouseMove();
return true;
@@ -139,17 +141,17 @@ bool Help::EndExtHelp()
void Help::EnableBalloonHelp()
{
- ImplGetSVData()->maHelpData.mbBalloonHelp = true;
+ ImplGetSVHelpData().mbBalloonHelp = true;
}
void Help::DisableBalloonHelp()
{
- ImplGetSVData()->maHelpData.mbBalloonHelp = false;
+ ImplGetSVHelpData().mbBalloonHelp = false;
}
bool Help::IsBalloonHelpEnabled()
{
- return ImplGetSVData()->maHelpData.mbBalloonHelp;
+ return ImplGetSVHelpData().mbBalloonHelp;
}
void Help::ShowBalloon( vcl::Window* pParent,
@@ -162,17 +164,17 @@ void Help::ShowBalloon( vcl::Window* pParent,
void Help::EnableQuickHelp()
{
- ImplGetSVData()->maHelpData.mbQuickHelp = true;
+ ImplGetSVHelpData().mbQuickHelp = true;
}
void Help::DisableQuickHelp()
{
- ImplGetSVData()->maHelpData.mbQuickHelp = false;
+ ImplGetSVHelpData().mbQuickHelp = false;
}
bool Help::IsQuickHelpEnabled()
{
- return ImplGetSVData()->maHelpData.mbQuickHelp;
+ return ImplGetSVHelpData().mbQuickHelp;
}
void Help::ShowQuickHelp( vcl::Window* pParent,
@@ -188,7 +190,7 @@ void Help::ShowQuickHelp( vcl::Window* pParent,
void Help::HideBalloonAndQuickHelp()
{
- HelpTextWindow const * pHelpWin = ImplGetSVData()->maHelpData.mpHelpWin;
+ HelpTextWindow const * pHelpWin = ImplGetSVHelpData().mpHelpWin;
bool const bIsVisible = ( pHelpWin != nullptr ) && pHelpWin->IsVisible();
ImplDestroyHelpWindow( bIsVisible );
}
@@ -248,7 +250,7 @@ void Help::HidePopover(vcl::Window const * pParent, void* nId)
// trigger update, so that a Paint is instantly triggered since we do not save the background
pFrameWindow->ImplUpdateAll();
pHelpWin.disposeAndClear();
- ImplGetSVData()->maHelpData.mnLastHelpHideTime = tools::Time::GetSystemTicks();
+ ImplGetSVHelpData().mnLastHelpHideTime = tools::Time::GetSystemTicks();
}
HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle ) :
@@ -269,9 +271,8 @@ HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal
SetHelpText( rText );
Window::SetHelpText( rText );
- ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maHelpData.mbSetKeyboardHelp )
- pSVData->maHelpData.mbKeyboardHelp = true;
+ if ( ImplGetSVHelpData().mbSetKeyboardHelp )
+ ImplGetSVHelpData().mbKeyboardHelp = true;
maShowTimer.SetInvokeHandler( LINK( this, HelpTextWindow, TimerHdl ) );
@@ -317,8 +318,8 @@ void HelpTextWindow::dispose()
maShowTimer.Stop();
maHideTimer.Stop();
- if( this == ImplGetSVData()->maHelpData.mpHelpWin )
- ImplGetSVData()->maHelpData.mpHelpWin = nullptr;
+ if( this == ImplGetSVHelpData().mpHelpWin )
+ ImplGetSVHelpData().mpHelpWin = nullptr;
FloatingWindow::dispose();
}
@@ -423,7 +424,7 @@ void HelpTextWindow::ShowHelp(bool bNoDelay)
if (!bNoDelay)
{
// In case of ExtendedHelp display help sooner
- if ( ImplGetSVData()->maHelpData.mbExtHelpMode )
+ if ( ImplGetSVHelpData().mbExtHelpMode )
nTimeout = 15;
else
{
@@ -445,8 +446,7 @@ IMPL_LINK( HelpTextWindow, TimerHdl, Timer*, pTimer, void)
if ( mnHelpWinStyle == HELPWINSTYLE_QUICK )
{
// start auto-hide-timer for non-ShowTip windows
- ImplSVData* pSVData = ImplGetSVData();
- if ( this == pSVData->maHelpData.mpHelpWin )
+ if ( this == ImplGetSVHelpData().mpHelpWin )
maHideTimer.Start();
}
ImplShow();
@@ -487,12 +487,12 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe
return;
}
- ImplSVData* pSVData = ImplGetSVData();
+ ImplSVHelpData& aHelpData = ImplGetSVHelpData();
- if (rHelpText.isEmpty() && !pSVData->maHelpData.mbRequestingHelp)
+ if (rHelpText.isEmpty() && !aHelpData.mbRequestingHelp)
return;
- VclPtr<HelpTextWindow> pHelpWin = pSVData->maHelpData.mpHelpWin;
+ VclPtr<HelpTextWindow> pHelpWin = aHelpData.mpHelpWin;
bool bNoDelay = false;
if ( pHelpWin )
{
@@ -501,7 +501,7 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe
if ( ( rHelpText.isEmpty()
|| ( pHelpWin->GetWinStyle() != nHelpWinStyle )
)
- && pSVData->maHelpData.mbRequestingHelp
+ && aHelpData.mbRequestingHelp
)
{
// remove help window if no HelpText or
@@ -515,7 +515,7 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe
else
{
bool const bUpdate = (pHelpWin->GetHelpText() != rHelpText) ||
- ((pHelpWin->GetHelpArea() != rHelpArea) && pSVData->maHelpData.mbRequestingHelp);
+ ((pHelpWin->GetHelpArea() != rHelpArea) && aHelpData.mbRequestingHelp);
if (bUpdate)
{
vcl::Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
@@ -536,11 +536,11 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe
return;
sal_uInt64 nCurTime = tools::Time::GetSystemTicks();
- if ( ( nCurTime - pSVData->maHelpData.mnLastHelpHideTime ) < HelpSettings::GetTipDelay() )
+ if ( ( nCurTime - aHelpData.mnLastHelpHideTime ) < HelpSettings::GetTipDelay() )
bNoDelay = true;
pHelpWin = VclPtr<HelpTextWindow>::Create( pParent, rHelpText, nHelpWinStyle, nStyle );
- pSVData->maHelpData.mpHelpWin = pHelpWin;
+ aHelpData.mpHelpWin = pHelpWin;
pHelpWin->SetHelpArea( rHelpArea );
// positioning
@@ -548,7 +548,7 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe
pHelpWin->SetOutputSizePixel( aSz );
ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea );
// if not called from Window::RequestHelp, then without delay...
- if ( !pSVData->maHelpData.mbRequestingHelp )
+ if ( !aHelpData.mbRequestingHelp )
bNoDelay = true;
pHelpWin->ShowHelp(bNoDelay);
@@ -556,8 +556,12 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe
void ImplDestroyHelpWindow( bool bUpdateHideTime )
{
- ImplSVData* pSVData = ImplGetSVData();
- VclPtr<HelpTextWindow> pHelpWin = pSVData->maHelpData.mpHelpWin;
+ ImplDestroyHelpWindow(ImplGetSVHelpData(), bUpdateHideTime);
+}
+
+void ImplDestroyHelpWindow(ImplSVHelpData& rHelpData, bool bUpdateHideTime)
+{
+ VclPtr<HelpTextWindow> pHelpWin = rHelpData.mpHelpWin;
if ( pHelpWin )
{
vcl::Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
@@ -565,12 +569,12 @@ void ImplDestroyHelpWindow( bool bUpdateHideTime )
tools::Rectangle aInvRect( pHelpWin->GetWindowExtentsRelative( pWindow ) );
if( pHelpWin->IsVisible() )
pWindow->Invalidate( aInvRect );
- pSVData->maHelpData.mpHelpWin = nullptr;
- pSVData->maHelpData.mbKeyboardHelp = false;
+ rHelpData.mpHelpWin = nullptr;
+ rHelpData.mbKeyboardHelp = false;
pHelpWin->Hide();
pHelpWin.disposeAndClear();
if( bUpdateHideTime )
- pSVData->maHelpData.mnLastHelpHideTime = tools::Time::GetSystemTicks();
+ rHelpData.mnLastHelpHideTime = tools::Time::GetSystemTicks();
}
}
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 877f3011d536..a9377fa6732b 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -62,6 +62,10 @@ namespace
{
struct private_aImplSVData :
public rtl::Static<ImplSVData, private_aImplSVData> {};
+ /// Default instance ensures that ImplSVData::mpHelpData is never null.
+ struct private_aImplSVHelpData :
+ public rtl::Static<ImplSVHelpData, private_aImplSVHelpData> {};
+
}
ImplSVData* ImplGetSVData() {
@@ -353,6 +357,83 @@ void LocaleConfigurationListener::ConfigurationChanged( utl::ConfigurationBroadc
}
+ImplSVHelpData* CreateSVHelpData()
+{
+ if (!comphelper::LibreOfficeKit::isActive())
+ return nullptr;
+
+ ImplSVHelpData* pNewData = new ImplSVHelpData;
+
+ // Set options set globally
+ ImplSVHelpData& aStaticHelpData = private_aImplSVHelpData::get();
+ pNewData->mbContextHelp = aStaticHelpData.mbContextHelp;
+ pNewData->mbExtHelp = aStaticHelpData.mbExtHelp;
+ pNewData->mbExtHelpMode = aStaticHelpData.mbExtHelpMode;
+ pNewData->mbOldBalloonMode = aStaticHelpData.mbOldBalloonMode;
+ pNewData->mbBalloonHelp = aStaticHelpData.mbBalloonHelp;
+ pNewData->mbQuickHelp = aStaticHelpData.mbQuickHelp;
+
+ return pNewData;
+}
+
+void DestroySVHelpData(ImplSVHelpData* pSVHelpData)
+{
+ if (!comphelper::LibreOfficeKit::isActive())
+ return;
+
+ // Change the SVData's help date if neccessary
+ if(ImplGetSVData()->mpHelpData == pSVHelpData)
+ {
+ ImplGetSVData()->mpHelpData = &private_aImplSVHelpData::get();
+ }
+
+ if(pSVHelpData)
+ {
+ ImplDestroyHelpWindow(*pSVHelpData, false);
+ delete pSVHelpData;
+ }
+}
+
+void SetSVHelpData(ImplSVHelpData* pSVHelpData)
+{
+ if (!comphelper::LibreOfficeKit::isActive())
+ return;
+
+ ImplSVData* pSVData = ImplGetSVData();
+ if (pSVData->mpHelpData != pSVHelpData)
+ {
+ // If current one is the static, clean it up to avoid having lingering references.
+ if (pSVData->mpHelpData == &private_aImplSVHelpData::get())
+ {
+ pSVData->mpHelpData->mpHelpWin.reset();
+ }
+
+ pSVData->mpHelpData = pSVHelpData;
+ if (pSVData->mpHelpData == nullptr)
+ {
+ pSVData->mpHelpData = &private_aImplSVHelpData::get(); // Never leave it null.
+ }
+ }
+}
+
+ImplSVData::ImplSVData()
+{
+ mpHelpData = &private_aImplSVHelpData::get();
+}
+
+ImplSVHelpData& ImplGetSVHelpData()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if(pSVData->mpHelpData)
+ {
+ return *pSVData->mpHelpData;
+ }
+ else
+ {
+ return private_aImplSVHelpData::get();
+ }
+}
+
ImplSVData::~ImplSVData() {}
ImplSVAppData::~ImplSVAppData() {}
ImplSVGDIData::~ImplSVGDIData() {}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 49551be5f901..b7adc843e472 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -234,7 +234,7 @@ void Window::dispose()
ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maHelpData.mpHelpWin && (pSVData->maHelpData.mpHelpWin->GetParent() == this) )
+ if ( ImplGetSVHelpData().mpHelpWin && (ImplGetSVHelpData().mpHelpWin->GetParent() == this) )
ImplDestroyHelpWindow( true );
SAL_WARN_IF( pSVData->maWinData.mpTrackWin.get() == this, "vcl.window",
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index c8b9ddc72227..190a0de4a717 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -84,7 +84,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
if ( !pFloat || bHitTestInsideRect )
{
- if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp )
+ if ( ImplGetSVHelpData().mpHelpWin && !ImplGetSVHelpData().mbKeyboardHelp )
ImplDestroyHelpWindow( true );
pChild->ImplGetFrame()->SetPointer( PointerStyle::Arrow );
return true;
@@ -167,27 +167,27 @@ static void ImplHandleMouseHelpRequest( vcl::Window* pChild, const Point& rMouse
return;
}
- ImplSVData* pSVData = ImplGetSVData();
- if ( !pSVData->maHelpData.mpHelpWin ||
- !( pSVData->maHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
- pChild->IsWindowOrChild( pSVData->maHelpData.mpHelpWin ) ) )
+ ImplSVHelpData& aHelpData = ImplGetSVHelpData();
+ if ( !aHelpData.mpHelpWin ||
+ !( aHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
+ pChild->IsWindowOrChild( aHelpData.mpHelpWin ) ) )
{
HelpEventMode nHelpMode = HelpEventMode::NONE;
- if ( pSVData->maHelpData.mbQuickHelp )
+ if ( aHelpData.mbQuickHelp )
nHelpMode = HelpEventMode::QUICK;
- if ( pSVData->maHelpData.mbBalloonHelp )
+ if ( aHelpData.mbBalloonHelp )
nHelpMode |= HelpEventMode::BALLOON;
if ( bool(nHelpMode) )
{
if ( pChild->IsInputEnabled() && !pChild->IsInModalMode() )
{
HelpEvent aHelpEvent( rMousePos, nHelpMode );
- pSVData->maHelpData.mbRequestingHelp = true;
+ aHelpData.mbRequestingHelp = true;
pChild->RequestHelp( aHelpEvent );
- pSVData->maHelpData.mbRequestingHelp = false;
+ aHelpData.mbRequestingHelp = false;
}
// #104172# do not kill keyboard activated tooltips
- else if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp)
+ else if ( aHelpData.mpHelpWin && !aHelpData.mbKeyboardHelp)
{
ImplDestroyHelpWindow( true );
}
@@ -197,8 +197,7 @@ static void ImplHandleMouseHelpRequest( vcl::Window* pChild, const Point& rMouse
static void ImplSetMousePointer( vcl::Window const * pChild )
{
- ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maHelpData.mbExtHelpMode )
+ if ( ImplGetSVHelpData().mbExtHelpMode )
pChild->ImplGetFrame()->SetPointer( PointerStyle::Help );
else
pChild->ImplGetFrame()->SetPointer( pChild->ImplGetMousePointer() );
@@ -269,6 +268,7 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
long nX, long nY, sal_uInt64 nMsgTime,
sal_uInt16 nCode, MouseEventModifiers nMode )
{
+ ImplSVHelpData& aHelpData = ImplGetSVHelpData();
ImplSVData* pSVData = ImplGetSVData();
Point aMousePos( nX, nY );
VclPtr<vcl::Window> pChild;
@@ -281,11 +281,11 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
// mousebuttonup event
if ( (nSVEvent == MouseNotifyEvent::MOUSEBUTTONDOWN) || (nSVEvent == MouseNotifyEvent::MOUSEBUTTONUP) )
{
- if ( (nSVEvent == MouseNotifyEvent::MOUSEBUTTONUP) && pSVData->maHelpData.mbExtHelpMode )
+ if ( (nSVEvent == MouseNotifyEvent::MOUSEBUTTONUP) && aHelpData.mbExtHelpMode )
Help::EndExtHelp();
- if ( pSVData->maHelpData.mpHelpWin )
+ if ( aHelpData.mpHelpWin )
{
- if( xWindow->ImplGetWindow() == pSVData->maHelpData.mpHelpWin )
+ if( xWindow->ImplGetWindow() == aHelpData.mpHelpWin )
{
ImplDestroyHelpWindow( false );
return true; // xWindow is dead now - avoid crash!
@@ -313,7 +313,7 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
if ( bMouseLeave )
{
pWinFrameData->mbMouseIn = false;
- if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp )
+ if ( ImplGetSVHelpData().mpHelpWin && !ImplGetSVHelpData().mbKeyboardHelp )
{
ImplDestroyHelpWindow( true );
@@ -683,9 +683,9 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
{
// if the MouseMove handler changes the help window's visibility
// the HelpRequest handler should not be called anymore
- vcl::Window* pOldHelpTextWin = pSVData->maHelpData.mpHelpWin;
+ vcl::Window* pOldHelpTextWin = ImplGetSVHelpData().mpHelpWin;
pChild->MouseMove( aMEvt );
- if ( pOldHelpTextWin != pSVData->maHelpData.mpHelpWin )
+ if ( pOldHelpTextWin != ImplGetSVHelpData().mpHelpWin )
bCallHelpRequest = false;
}
}
@@ -728,7 +728,7 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
if ( nSVEvent == MouseNotifyEvent::MOUSEMOVE )
{
- if ( bCallHelpRequest && !pSVData->maHelpData.mbKeyboardHelp )
+ if ( bCallHelpRequest && !ImplGetSVHelpData().mbKeyboardHelp )
ImplHandleMouseHelpRequest( pChild, pChild->OutputToScreenPixel( aMEvt.GetPosPixel() ) );
bRet = true;
}
@@ -902,13 +902,13 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
// handle tracking window
if ( nSVEvent == MouseNotifyEvent::KEYINPUT )
{
- if ( pSVData->maHelpData.mbExtHelpMode )
+ if ( ImplGetSVHelpData().mbExtHelpMode )
{
Help::EndExtHelp();
if ( nEvCode == KEY_ESCAPE )
return true;
}
- if ( pSVData->maHelpData.mpHelpWin )
+ if ( ImplGetSVHelpData().mpHelpWin )
ImplDestroyHelpWindow( false );
// AutoScrollMode
@@ -1048,15 +1048,15 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
HelpEvent aHelpEvent( aPos, HelpEventMode::BALLOON );
aHelpEvent.SetKeyboardActivated( true );
- pSVData->maHelpData.mbSetKeyboardHelp = true;
+ ImplGetSVHelpData().mbSetKeyboardHelp = true;
pChild->RequestHelp( aHelpEvent );
- pSVData->maHelpData.mbSetKeyboardHelp = false;
+ ImplGetSVHelpData().mbSetKeyboardHelp = false;
}
else if ( (nCode == KEY_F1) || (nCode == KEY_HELP) )
{
if ( !aKeyCode.GetModifier() )
{
- if ( pSVData->maHelpData.mbContextHelp )
+ if ( ImplGetSVHelpData().mbContextHelp )
{
Point aMousePos = pChild->OutputToScreenPixel( pChild->GetPointerPosPixel() );
HelpEvent aHelpEvent( aMousePos, HelpEventMode::CONTEXT );
@@ -1067,7 +1067,7 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
}
else if ( aKeyCode.IsShift() )
{
- if ( pSVData->maHelpData.mbExtHelp )
+ if ( ImplGetSVHelpData().mbExtHelp )
Help::StartExtHelp();
else
bRet = false;
@@ -1346,7 +1346,7 @@ bool HandleGestureEventBase::Setup()
if (m_pSVData->maWinData.mpAutoScrollWin)
m_pSVData->maWinData.mpAutoScrollWin->EndAutoScroll();
- if (m_pSVData->maHelpData.mpHelpWin)
+ if (ImplGetSVHelpData().mpHelpWin)
ImplDestroyHelpWindow( true );
return !m_pWindow->IsDisposed();
}
@@ -1620,7 +1620,7 @@ void ImplHandleResize( vcl::Window* pWindow, long nNewWidth, long nNewHeight )
if (bChanged && pWindow->GetStyle() & (WB_MOVEABLE|WB_SIZEABLE))
{
KillOwnPopups( pWindow );
- if( pWindow->ImplGetWindow() != ImplGetSVData()->maHelpData.mpHelpWin )
+ if( pWindow->ImplGetWindow() != ImplGetSVHelpData().mpHelpWin )
ImplDestroyHelpWindow( true );
}
@@ -1699,7 +1699,7 @@ static void ImplHandleMove( vcl::Window* pWindow )
if( pWindow->GetStyle() & (WB_MOVEABLE|WB_SIZEABLE) )
{
KillOwnPopups( pWindow );
- if( pWindow->ImplGetWindow() != ImplGetSVData()->maHelpData.mpHelpWin )
+ if( pWindow->ImplGetWindow() != ImplGetSVHelpData().mpHelpWin )
ImplDestroyHelpWindow( true );
}
@@ -1922,9 +1922,9 @@ static void ImplHandleClose( const vcl::Window* pWindow )
pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
}
- if ( pSVData->maHelpData.mbExtHelpMode )
+ if ( ImplGetSVHelpData().mbExtHelpMode )
Help::EndExtHelp();
- if ( pSVData->maHelpData.mpHelpWin )
+ if ( ImplGetSVHelpData().mpHelpWin )
ImplDestroyHelpWindow( false );
// AutoScrollMode
if ( pSVData->maWinData.mpAutoScrollWin )
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 820828c3e796..2fc5e123b0f3 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -12305,8 +12305,8 @@ namespace
gboolean signalTooltipQuery(GtkWidget* pWidget, gint /*x*/, gint /*y*/,
gboolean /*keyboard_mode*/, GtkTooltip *tooltip)
{
- const ImplSVData* pSVData = ImplGetSVData();
- if (pSVData->maHelpData.mbBalloonHelp)
+ const ImplSVHelpData& aHelpData = ImplGetSVHelpData();
+ if (aHelpData.mbBalloonHelp)
{
/*Current mechanism which needs help installed*/
OString sHelpId = ::get_help_id(pWidget);
@@ -12474,8 +12474,8 @@ private:
OString sHelpId = m_aUtf8HelpRoot + sBuildableName;
set_help_id(pWidget, sHelpId);
//hook up for extended help
- const ImplSVData* pSVData = ImplGetSVData();
- if (pSVData->maHelpData.mbBalloonHelp && !GTK_IS_DIALOG(pWidget) && !GTK_IS_ASSISTANT(pWidget))
+ const ImplSVHelpData& aHelpData = ImplGetSVHelpData();
+ if (aHelpData.mbBalloonHelp && !GTK_IS_DIALOG(pWidget) && !GTK_IS_ASSISTANT(pWidget))
{
gtk_widget_set_has_tooltip(pWidget, true);
g_signal_connect(pWidget, "query-tooltip", G_CALLBACK(signalTooltipQuery), nullptr);
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index aedba78e3fca..0bc9d7c7512a 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -3033,7 +3033,7 @@ static bool ImplHandleMouseMsg( HWND hWnd, UINT nMsg,
aPt.x = static_cast<short>(LOWORD(lParam));
aPt.y = static_cast<short>(HIWORD(lParam));
ScreenToClient(hWnd, &aPt);
- if (const auto& pHelpWin = ImplGetSVData()->maHelpData.mpHelpWin)
+ if (const auto& pHelpWin = ImplGetSVHelpData().mpHelpWin)
{
const tools::Rectangle& rHelpRect = pHelpWin->GetHelpArea();
if (rHelpRect.IsInside(Point(aPt.x, aPt.y)))
commit 1baf051aa1055e9789585fdd4859d23e6e14ac7d
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Jul 22 17:26:38 2019 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:48:20 2020 +0200
lok: don't show tooltip for popup menus inside dialogs
Check Character Properties dialog -> Font Effects -> Font Color
popup button. Moving the mouse above the colors, a tooltip is shown
with the color name. However when the tooltip window is displayed
LO online closes the popup window unexpectedly.
Change-Id: I4bb8611640e122fc8187271c8c843c9f29fc0ce0
Reviewed-on: https://gerrit.libreoffice.org/84716
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/84802
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 72cffe8411d3..c8b9ddc72227 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -157,6 +157,16 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
static void ImplHandleMouseHelpRequest( vcl::Window* pChild, const Point& rMousePos )
{
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // Ignore tooltips in popup color palettes
+ // (e.g. Character Properties dialog -> Font Effects -> Font Color)
+ if(pChild->GetType() == WindowType::CONTROL &&
+ pChild->GetParent() && pChild->GetParent()->GetParent() &&
+ pChild->GetParent()->GetParent()->GetType() == WindowType::DOCKINGWINDOW)
+ return;
+ }
+
ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maHelpData.mpHelpWin ||
!( pSVData->maHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
commit 9ea29c4f7540ba2f9f23fa6d024d69578d36ad6a
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sat Jul 20 19:17:39 2019 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:48:02 2020 +0200
lok: show tooltips on dialogs
Change-Id: I40fca6ff13cc41ec9e1ec6bba48dce207e364c79
Reviewed-on: https://gerrit.libreoffice.org/84715
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/84801
Tested-by: Jenkins
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index baa3a46bc978..672eb6236fee 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -651,7 +651,11 @@ void FloatingWindow::StateChanged( StateChangedType nType )
SetLOKNotifier(pParent->GetLOKNotifier());
aItems.emplace_back("type", "child");
aItems.emplace_back("parentId", OString::number(pParent->GetLOKWindowId()));
- aItems.emplace_back("position", mpImplData->maPos.toString()); // pixels
+ if (mbInPopupMode)
+ aItems.emplace_back("position", mpImplData->maPos.toString()); // pixels
+ else // mpImplData->maPos is not set
+ aItems.emplace_back("position", GetPosPixel().toString());
+
}
aItems.emplace_back("size", GetSizePixel().toString());
GetLOKNotifier()->notifyWindow(GetLOKWindowId(), "created", aItems);
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 424b8b6cdbfa..72cffe8411d3 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -157,9 +157,6 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
static void ImplHandleMouseHelpRequest( vcl::Window* pChild, const Point& rMousePos )
{
- if (comphelper::LibreOfficeKit::isActive())
- return;
-
ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maHelpData.mpHelpWin ||
!( pSVData->maHelpData.mpHelpWin->IsWindowOrChild( pChild ) ||
commit 2fb35d84b3e5094cfb7595e56721ea24f577c4fe
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Nov 29 18:19:58 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:47:33 2020 +0200
SpellingPopup: lok: keep the selection to make context menu work.
Change-Id: Ida46a1140c889d1864b423eb9c5512d99a028fce
Reviewed-on: https://gerrit.libreoffice.org/84155
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 1b048c9d16b7..bc7c8e7502fb 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1436,37 +1436,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
break;
case SID_SPELLCHECK_IGNORE:
{
- // If there is not selection, we need to create one, before ignoring
- if(!rWrtSh.HasSelection())
- {
- OUString sApplyText;
- const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
- if (pItem2)
- sApplyText = pItem2->GetValue();
-
- const OUString sGrammarType("Grammar");
- const OUString sSpellingType("Spelling");
-
- if (sApplyText == sGrammarType)
- {
- linguistic2::ProofreadingResult aGrammarCheckRes;
- sal_Int32 nErrorInResult = -1;
- uno::Sequence< OUString > aSuggestions;
- sal_Int32 nErrorPosInText = -1;
- SwRect aToFill;
- bool bCorrectionRes = rWrtSh.GetGrammarCorrection( aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, nullptr, aToFill );
- if (!bCorrectionRes)
- return;
- }
- else if (sApplyText == sSpellingType)
- {
- SwRect aToFill;
- uno::Reference< linguistic2::XSpellAlternatives > xSpellAlt( rWrtSh.GetCorrection(nullptr, aToFill) );
- if (!xSpellAlt.is())
- return;
- }
- }
-
SwPaM *pPaM = rWrtSh.GetCursor();
if (pPaM)
SwEditShell::IgnoreGrammarErrorAt( *pPaM );
@@ -1541,19 +1510,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
if(-1 != (nPos = sApplyText.indexOf( sGrammarRule )))
{
sApplyText = sApplyText.replaceAt(nPos, sGrammarRule.getLength(), "");
- if(rWrtSh.HasSelection())
- {
- bGrammar = true;
- }
- else
- {
- linguistic2::ProofreadingResult aGrammarCheckRes;
- sal_Int32 nErrorInResult = -1;
- uno::Sequence< OUString > aSuggestions;
- sal_Int32 nErrorPosInText = -1;
- SwRect aToFill;
- bGrammar = rWrtSh.GetGrammarCorrection( aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, nullptr, aToFill );
- }
+ bGrammar = true;
}
else if (-1 != (nPos = sApplyText.indexOf( sSpellingRule )))
{
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index 281728e2e318..c79819e8789d 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -794,7 +794,8 @@ bool SwView::ExecSpellPopup(const Point& rPt)
}
}
- m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
+ if (!comphelper::LibreOfficeKit::isActive())
+ m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
m_pWrtShell->LockView( bOldViewLock );
}
}
commit 1bf6eab7de23c1b8b7a0d5d204b540e627a95afe
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Nov 29 15:23:19 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:47:09 2020 +0200
Remove unused variable.
Change-Id: I34a15cb1e457c3ac0329e5ba735ac93db99e9fbf
Reviewed-on: https://gerrit.libreoffice.org/84154
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index 7aae55d310a2..281728e2e318 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -788,7 +788,6 @@ bool SwView::ExecSpellPopup(const Point& rPt)
}
else
{
- boost::property_tree::ptree aMenu = SfxDispatcher::fillPopupMenu(&xPopup->GetMenu());
xPopup->Execute(aToFill.SVRect(), m_pEditWin);
}
}
commit d53cadc2a571312f5ebf1c2d5ca1bf831ae6c22b
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Nov 29 15:00:22 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:46:43 2020 +0200
SpellingPopup: lok: we don't need to disable menu items for online.
Now, that we generate the conext menu in JS code, we can control
the visibility of items.
Change-Id: I09112619a9669e6ebf1a8d468e0329b8914db0ff
Reviewed-on: https://gerrit.libreoffice.org/84153
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index 16e068d20372..48c538a75a6a 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -304,13 +304,6 @@ SwSpellPopup::SwSpellPopup(
vcl::CommandInfoProvider::GetPopupLabelForCommand(aProperties));
}
- if (comphelper::LibreOfficeKit::isActive())
- {
- m_xPopupMenu->HideItem(m_nCorrectDialogId);
- m_xPopupMenu->HideItem(m_nAddId);
- m_xPopupMenu->HideItem(m_nAddMenuId);
- m_xPopupMenu->HideItem(m_nCorrectMenuId);
- }
sal_uInt16 nItemPos = m_xPopupMenu->GetItemPos(m_nIgnoreWordId);
OUString aIgnoreSelection( SwResId( STR_IGNORE_SELECTION ) );
m_xPopupMenu->InsertItem(MN_IGNORE_SELECTION, aIgnoreSelection, MenuItemBits::NONE, OString(), nItemPos);
@@ -592,11 +585,6 @@ SwSpellPopup::SwSpellPopup(
SvtLinguConfig().SetProperty( UPN_IS_GRAMMAR_INTERACTIVE, uno::makeAny( true ));
- if (comphelper::LibreOfficeKit::isActive())
- {
- m_xPopupMenu->HideItem(MN_EXPLANATION_LINK);
- }
-
InitItemCommands(rSuggestions);
}
commit 20f081af7bb934a10e103a13c6ebb70e15312696
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Nov 26 16:34:20 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:45:46 2020 +0200
SpellingPopup: Fix Ignore All execution.
Change-Id: I13520c1f14530cc1f04290d4d0b204cc45b124eb
Reviewed-on: https://gerrit.libreoffice.org/83786
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 6cc1d1d7b0c8..1b048c9d16b7 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1474,58 +1474,55 @@ void SwTextShell::Execute(SfxRequest &rReq)
break;
case SID_SPELLCHECK_IGNORE_ALL:
{
- if(!rWrtSh.HasSelection())
- {
- OUString sApplyText;
- const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
- if (pItem2)
- sApplyText = pItem2->GetValue();
+ OUString sApplyText;
+ const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
+ if (pItem2)
+ sApplyText = pItem2->GetValue();
- const OUString sGrammarType("Grammar");
- const OUString sSpellingType("Spelling");
+ const OUString sGrammarType("Grammar");
+ const OUString sSpellingType("Spelling");
- if(sApplyText == sGrammarType)
- {
- linguistic2::ProofreadingResult aGrammarCheckRes;
- sal_Int32 nErrorInResult = -1;
- uno::Sequence< OUString > aSuggestions;
- sal_Int32 nErrorPosInText = -1;
- SwRect aToFill;
- bool bCorrectionRes = rWrtSh.GetGrammarCorrection( aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, nullptr, aToFill );
- if(bCorrectionRes)
- {
- try {
- uno::Reference< linguistic2::XDictionary > xDictionary = LinguMgr::GetIgnoreAllList();
- aGrammarCheckRes.xProofreader->ignoreRule(
- aGrammarCheckRes.aErrors[ nErrorInResult ].aRuleIdentifier,
- aGrammarCheckRes.aLocale );
- // refresh the layout of the actual paragraph (faster)
- SwPaM *pPaM = rWrtSh.GetCursor();
- if (pPaM)
- SwEditShell::IgnoreGrammarErrorAt( *pPaM );
- // refresh the layout of all paragraphs (workaround to launch a dictionary event)
- xDictionary->setActive(false);
- xDictionary->setActive(true);
- }
- catch( const uno::Exception& )
- {
- }
+ if(sApplyText == sGrammarType)
+ {
+ linguistic2::ProofreadingResult aGrammarCheckRes;
+ sal_Int32 nErrorInResult = -1;
+ uno::Sequence< OUString > aSuggestions;
+ sal_Int32 nErrorPosInText = -1;
+ SwRect aToFill;
+ bool bCorrectionRes = rWrtSh.GetGrammarCorrection( aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, nullptr, aToFill );
+ if(bCorrectionRes)
+ {
+ try {
+ uno::Reference< linguistic2::XDictionary > xDictionary = LinguMgr::GetIgnoreAllList();
+ aGrammarCheckRes.xProofreader->ignoreRule(
+ aGrammarCheckRes.aErrors[ nErrorInResult ].aRuleIdentifier,
+ aGrammarCheckRes.aLocale );
+ // refresh the layout of the actual paragraph (faster)
+ SwPaM *pPaM = rWrtSh.GetCursor();
+ if (pPaM)
+ SwEditShell::IgnoreGrammarErrorAt( *pPaM );
+ // refresh the layout of all paragraphs (workaround to launch a dictionary event)
+ xDictionary->setActive(false);
+ xDictionary->setActive(true);
}
- }
- else if (sApplyText == sSpellingType)
- {
- SwRect aToFill;
- uno::Reference< linguistic2::XSpellAlternatives > xSpellAlt( rWrtSh.GetCorrection(nullptr, aToFill) );
- uno::Reference< linguistic2::XDictionary > xDictionary = LinguMgr::GetIgnoreAllList();
- OUString sWord(xSpellAlt->getWord());
- linguistic::DictionaryError nAddRes = linguistic::AddEntryToDic( xDictionary,
- sWord, false, OUString() );
- if (linguistic::DictionaryError::NONE != nAddRes && !xDictionary->getEntry(sWord).is())
+ catch( const uno::Exception& )
{
- SvxDicError(rWrtSh.GetView().GetFrameWeld(), nAddRes);
}
}
}
+ else if (sApplyText == sSpellingType)
+ {
+ SwRect aToFill;
+ uno::Reference< linguistic2::XSpellAlternatives > xSpellAlt( rWrtSh.GetCorrection(nullptr, aToFill) );
+ uno::Reference< linguistic2::XDictionary > xDictionary = LinguMgr::GetIgnoreAllList();
+ OUString sWord(xSpellAlt->getWord());
+ linguistic::DictionaryError nAddRes = linguistic::AddEntryToDic( xDictionary,
+ sWord, false, OUString() );
+ if (linguistic::DictionaryError::NONE != nAddRes && !xDictionary->getEntry(sWord).is())
+ {
+ SvxDicError(rWrtSh.GetView().GetFrameWeld(), nAddRes);
+ }
+ }
}
break;
case SID_SPELLCHECK_APPLY_SUGGESTION:
commit 8f0881dce5e8968930bfa95ce39fa29d7395fdf1
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Nov 22 18:05:26 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:44:46 2020 +0200
lok: Chart context menu: Disable menu items which are not available.
Change-Id: Id7487c581759389e66ca513381d6706f3ae49980
Reviewed-on: https://gerrit.libreoffice.org/83605
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/chart2/source/controller/inc/CommandDispatchContainer.hxx b/chart2/source/controller/inc/CommandDispatchContainer.hxx
index 72c2daaa9367..9d6cd7e2e97b 100644
--- a/chart2/source/controller/inc/CommandDispatchContainer.hxx
+++ b/chart2/source/controller/inc/CommandDispatchContainer.hxx
@@ -103,6 +103,8 @@ public:
const css::uno::Reference< css::frame::XController > & xChartController,
const css::util::URL & rURL );
+ css::uno::Reference< css::frame::XDispatch > getChartDispatcher() { return m_xChartDispatcher; }
+
void setDrawCommandDispatch( DrawCommandDispatch* pDispatch );
DrawCommandDispatch* getDrawCommandDispatch() { return m_pDrawCommandDispatch; }
void setShapeController( ShapeController* pController );
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index c4f20d871aa7..9266e61005c7 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -44,6 +44,7 @@
#include <servicenames_charttypes.hxx>
#include "DrawCommandDispatch.hxx"
#include <PopupRequest.hxx>
+#include "ControllerCommandDispatch.hxx"
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
@@ -1283,6 +1284,18 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
if (SfxViewShell* pViewShell = SfxViewShell::Current())
{
PopupMenu* pPopupMenu = static_cast<PopupMenu*>(comphelper::getUnoTunnelImplementation<VCLXMenu>(xPopupMenu)->GetMenu());
+ ControllerCommandDispatch* pCommandDispatch = dynamic_cast<ControllerCommandDispatch*>(m_aDispatchContainer.getChartDispatcher().get());
+ if(pCommandDispatch)
+ {
+ for (sal_uInt16 nPos = 0; nPos < pPopupMenu->GetItemCount(); nPos++)
+ {
+ const sal_uInt16 nItemId = pPopupMenu->GetItemId(nPos);
+ OUString aCommandURL = pPopupMenu->GetItemCommand(nItemId);
+ if(!pCommandDispatch->commandAvailable(aCommandURL))
+ pPopupMenu->EnableItem(nItemId, false);
+ }
+ }
+
boost::property_tree::ptree aMenu = SfxDispatcher::fillPopupMenu(pPopupMenu);
boost::property_tree::ptree aRoot;
aRoot.add_child("menu", aMenu);
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.hxx b/chart2/source/controller/main/ControllerCommandDispatch.hxx
index 4e105f86702c..b2f2a5e3dc51 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.hxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.hxx
@@ -65,6 +65,8 @@ public:
// late initialisation, especially for adding as listener
virtual void initialize() override;
+ bool commandAvailable( const OUString & rCommand );
+
protected:
// ____ XDispatch ____
virtual void SAL_CALL dispatch(
@@ -96,7 +98,6 @@ private:
const OUString & rURL,
const css::uno::Reference< css::frame::XStatusListener > & xSingleListener );
- bool commandAvailable( const OUString & rCommand );
void updateCommandAvailability();
bool isShapeControllerCommandAvailable( const OUString& rCommand );
commit dbbe8972b3386b7dbd09ac24ea0f108ad68d815f
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Thu Nov 21 16:13:06 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:44:27 2020 +0200
lok: Chart context menu: Replace tunneled context menu with JS context menu.
Change-Id: I36db90887bff86036093ce0732db6fc6c76e79f6
Reviewed-on: https://gerrit.libreoffice.org/83604
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 83411df39171..c4f20d871aa7 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -83,6 +83,9 @@
#include <sal/log.hxx>
#include <sfx2/lokhelper.hxx>
+#include <boost/property_tree/json_parser.hpp>
+#include <sfx2/dispatch.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#define DRGPIX 2 // Drag MinMove in Pixel
@@ -1273,29 +1276,28 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
if ( !xPopupController.is() || !xPopupMenu.is() )
return;
+ xPopupController->setPopupMenu( xPopupMenu );
+
if (comphelper::LibreOfficeKit::isActive())
{
- PopupMenu* pPopupMenu = static_cast<PopupMenu*>(comphelper::getUnoTunnelImplementation<VCLXMenu>(xPopupMenu)->GetMenu());
- pPopupMenu->SetLOKNotifier(SfxViewShell::Current());
-
- // the context menu expects a position related to the document window,
- // not to the chart window
- SfxInPlaceClient* pIPClient = SfxViewShell::Current()->GetIPClient();
- if (pIPClient)
+ if (SfxViewShell* pViewShell = SfxViewShell::Current())
{
- vcl::Window* pRootWin = pIPClient->GetEditWin();
- if (pRootWin)
- {
- Point aOffset = pChartWindow->GetOffsetPixelFrom(*pRootWin);
- aPos += aOffset;
- }
+ PopupMenu* pPopupMenu = static_cast<PopupMenu*>(comphelper::getUnoTunnelImplementation<VCLXMenu>(xPopupMenu)->GetMenu());
+ boost::property_tree::ptree aMenu = SfxDispatcher::fillPopupMenu(pPopupMenu);
+ boost::property_tree::ptree aRoot;
+ aRoot.add_child("menu", aMenu);
+
+ std::stringstream aStream;
+ boost::property_tree::write_json(aStream, aRoot, true);
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_MENU, aStream.str().c_str());
}
}
-
- xPopupController->setPopupMenu( xPopupMenu );
- xPopupMenu->execute( css::uno::Reference< css::awt::XWindowPeer >( m_xFrame->getContainerWindow(), css::uno::UNO_QUERY ),
- css::awt::Rectangle( aPos.X(), aPos.Y(), 0, 0 ),
- css::awt::PopupMenuDirection::EXECUTE_DEFAULT );
+ else
+ {
+ xPopupMenu->execute( css::uno::Reference< css::awt::XWindowPeer >( m_xFrame->getContainerWindow(), css::uno::UNO_QUERY ),
+ css::awt::Rectangle( aPos.X(), aPos.Y(), 0, 0 ),
+ css::awt::PopupMenuDirection::EXECUTE_DEFAULT );
+ }
css::uno::Reference< css::lang::XComponent > xComponent( xPopupController, css::uno::UNO_QUERY );
if ( xComponent.is() )
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6bad644e101b..d01f9cb8251d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3699,7 +3699,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
}
}
- if (aChartHelper.GetWindow())
+ if (aChartHelper.GetWindow() && aPropertyValuesVector.size() > 0)
{
if (aPropertyValuesVector[0].Name != "Action")
{
@@ -3741,7 +3741,17 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
}
bool bResult = false;
- if (bNotifyWhenFinished && pDocument->mpCallbackFlushHandlers.count(nView))
+ LokChartHelper aChartHelper(SfxViewShell::Current());
+
+ if (aChartHelper.GetWindow() )
+ {
+ util::URL aCommandURL;
+ aCommandURL.Path = aCommand.copy(5);
+ css::uno::Reference<css::frame::XDispatch>& aChartDispatcher = aChartHelper.GetXDispatcher();
+ aChartDispatcher->dispatch(aCommandURL, comphelper::containerToSequence(aPropertyValuesVector));
+ return;
+ }
+ else if (bNotifyWhenFinished && pDocument->mpCallbackFlushHandlers.count(nView))
{
bResult = comphelper::dispatchCommand(aCommand, comphelper::containerToSequence(aPropertyValuesVector),
new DispatchResultListener(pCommand, pDocument->mpCallbackFlushHandlers[nView]));
commit eef4c4c6b399e5d6814f22277a0d9f33806d5891
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sun Nov 24 11:59:31 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:44:08 2020 +0200
Fix some loplugin error.
Change-Id: I22c1efbacc5b2d35d49f8183929b6177bf91e93d
Reviewed-on: https://gerrit.libreoffice.org/83602
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index db1ee7ac73f5..5ce423517922 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -897,7 +897,7 @@ uno::Reference< XSpellAlternatives >
SwCursorMoveState eTmpState( MV_SETONLYTEXT );
SwTextNode *pNode = nullptr;
SwWrongList *pWrong = nullptr;
- if (pPt && GetLayout()->GetCursorOfst( &aPos, *(const_cast<Point*>(pPt)), &eTmpState ))
+ if (pPt && GetLayout()->GetCursorOfst( &aPos, *const_cast<Point*>(pPt), &eTmpState ))
pNode = aPos.nNode.GetNode().GetTextNode();
if (nullptr == pNode)
pNode = pCursor->GetNode().GetTextNode();
@@ -964,7 +964,7 @@ bool SwEditShell::GetGrammarCorrection(
SwCursorMoveState eTmpState( MV_SETONLYTEXT );
SwTextNode *pNode = nullptr;
SwGrammarMarkUp *pWrong = nullptr;
- if (pPt && GetLayout()->GetCursorOfst( &aPos, *(const_cast<Point*>(pPt)), &eTmpState ))
+ if (pPt && GetLayout()->GetCursorOfst( &aPos, *const_cast<Point*>(pPt), &eTmpState ))
pNode = aPos.nNode.GetNode().GetTextNode();
if (nullptr == pNode)
pNode = pCursor->GetNode().GetTextNode();
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index 60749b84e694..16e068d20372 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -621,7 +621,7 @@ void SwSpellPopup::InitItemCommands(const css::uno::Sequence< OUString >& aSugge
for(int i = 0; i < aSuggestions.getLength(); ++i)
{
sal_uInt16 nItemId = MN_SUGGESTION_START + i;
- OUString sCommandString = OUString(".uno:SpellCheckApplySuggestion?ApplyRule:string=");
+ OUString sCommandString = ".uno:SpellCheckApplySuggestion?ApplyRule:string=";
if(m_bGrammarResults)
sCommandString += "Grammar_";
else if (m_xSpellAlt.is())
@@ -633,9 +633,9 @@ void SwSpellPopup::InitItemCommands(const css::uno::Sequence< OUString >& aSugge
PopupMenu *pMenu = m_xPopupMenu->GetPopupMenu(m_nLangSelectionMenuId);
if(pMenu)
{
- for (auto item : m_aLangTable_Text)
+ for (const auto& item : m_aLangTable_Text)
{
- OUString sCommandString = OUString(".uno:LanguageStatus?Language:string=Current_") + item.second;
+ OUString sCommandString = ".uno:LanguageStatus?Language:string=Current_" + item.second;
pMenu->SetItemCommand(item.first, sCommandString);
}
@@ -647,9 +647,9 @@ void SwSpellPopup::InitItemCommands(const css::uno::Sequence< OUString >& aSugge
pMenu = m_xPopupMenu->GetPopupMenu(m_nLangParaMenuId);
if(pMenu)
{
- for (auto item : m_aLangTable_Paragraph)
+ for (const auto& item : m_aLangTable_Paragraph)
{
- OUString sCommandString = OUString(".uno:LanguageStatus?Language:string=Paragraph_") + item.second;
+ OUString sCommandString = ".uno:LanguageStatus?Language:string=Paragraph_" + item.second;
pMenu->SetItemCommand(item.first, sCommandString);
}
commit 631b75b9352ffd93bb50efdda91fc00bd13fe0b9
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Nov 18 19:15:07 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Wed May 13 18:43:55 2020 +0200
SpellingPopup: Create separate SID for Ignore / IgnoreAll / suggestion.
Change-Id: I20f41f511ea38f960f081f92bc36e095f7752d28
Reviewed-on: https://gerrit.libreoffice.org/83599
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 6e9cd310f9ad..2842dcf5a77f 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -355,7 +355,9 @@ class SvxSetItem;
#define SID_SPELL_DIALOG ( SID_SVX_START + 243 )
#define SID_INSERT_DRAW ( SID_SVX_START + 244 )
#define SID_THESAURUS ( SID_SVX_START + 245 )
-#define SID_APPLY_SPELLCHECKING ( SID_SVX_START + 246 )
+#define SID_SPELLCHECK_IGNORE ( SID_SVX_START + 246 )
+#define SID_SPELLCHECK_IGNORE_ALL ( SID_SVX_START + 247 )
+#define SID_SPELLCHECK_APPLY_SUGGESTION ( SID_SVX_START + 248 )
// CAUTION! Range <250 .. 250> used by EditEngine (!)
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index ceb8ffee9fbc..28ec0c674e3a 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -2678,9 +2678,19 @@
<value xml:lang="en-US">Language Status</value>
</prop>
</node>
- <node oor:name=".uno:ApplySpellChecking" oor:op="replace">
+ <node oor:name=".uno:SpellCheckIgnore" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Apply Spell Checking</value>
+ <value xml:lang="en-US">Ignore</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SpellCheckIgnoreAll" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">IgnoreAll</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:SpellCheckApplySuggestion" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Apply Suggestion</value>
</prop>
</node>
<node oor:name=".uno:ChooseControls" oor:op="replace">
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index f2bdfe2430e3..ed413935bb25 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -12170,7 +12170,41 @@ SfxVoidItem EditQrCode SID_EDIT_QRCODE
GroupId = SfxGroupId::Edit;
]
-SfxVoidItem ApplySpellChecking SID_APPLY_SPELLCHECKING
+SfxVoidItem SpellCheckIgnore SID_SPELLCHECK_IGNORE
+(SfxStringItem Type FN_PARAM_1)
+[
+ AutoUpdate = FALSE,
+ FastCall = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = SfxGroupId::Format;
+]
+
+SfxVoidItem SpellCheckIgnoreAll SID_SPELLCHECK_IGNORE_ALL
+(SfxStringItem Type FN_PARAM_1)
+[
+ AutoUpdate = FALSE,
+ FastCall = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = SfxGroupId::Format;
+]
+
+SfxVoidItem SpellCheckApplySuggestion SID_SPELLCHECK_APPLY_SUGGESTION
(SfxStringItem ApplyRule FN_PARAM_1)
[
AutoUpdate = FALSE,
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 94bcc81cd5ac..102699cbad19 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -1740,7 +1740,19 @@ interface BaseText
StateMethod = GetState ;
]
- SID_APPLY_SPELLCHECKING
+ SID_SPELLCHECK_IGNORE
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
+
+ SID_SPELLCHECK_IGNORE_ALL
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
+
+ SID_SPELLCHECK_APPLY_SUGGESTION
[
ExecMethod = Execute ;
StateMethod = GetState ;
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index 0c7e2ef2f982..60749b84e694 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -606,21 +606,22 @@ void SwSpellPopup::InitItemCommands(const css::uno::Sequence< OUString >& aSugge
{
if (comphelper::LibreOfficeKit::isActive())
{
+ // None is added only for LOK, it means there is no need to execute anything
m_xPopupMenu->SetItemCommand(MN_SHORT_COMMENT, ".uno:None");
m_xPopupMenu->SetItemCommand(m_nSpellDialogId, ".uno:SpellingAndGrammarDialog");
if(m_bGrammarResults)
- m_xPopupMenu->SetItemCommand(m_nIgnoreWordId, ".uno:ApplySpellChecking?ApplyRule:string=IgnoreAll_Grammar");
+ m_xPopupMenu->SetItemCommand(m_nIgnoreWordId, ".uno:SpellCheckIgnoreAll?Type:string=Grammar");
else
- m_xPopupMenu->SetItemCommand(m_nIgnoreWordId, ".uno:ApplySpellChecking?ApplyRule:string=IgnoreAll_Spelling");
+ m_xPopupMenu->SetItemCommand(m_nIgnoreWordId, ".uno:SpellCheckIgnoreAll?Type:string=Spelling");
if(m_bGrammarResults)
- m_xPopupMenu->SetItemCommand(MN_IGNORE_SELECTION, ".uno:ApplySpellChecking?ApplyRule:string=Ignore_Grammar");
+ m_xPopupMenu->SetItemCommand(MN_IGNORE_SELECTION, ".uno:SpellCheckIgnore?Type:string=Grammar");
else
- m_xPopupMenu->SetItemCommand(MN_IGNORE_SELECTION, ".uno:ApplySpellChecking?ApplyRule:string=Ignore_Spelling");
+ m_xPopupMenu->SetItemCommand(MN_IGNORE_SELECTION, ".uno:SpellCheckIgnore?Type:string=Spelling");
for(int i = 0; i < aSuggestions.getLength(); ++i)
{
sal_uInt16 nItemId = MN_SUGGESTION_START + i;
- OUString sCommandString = OUString(".uno:ApplySpellChecking?ApplyRule:string=Replace_");
+ OUString sCommandString = OUString(".uno:SpellCheckApplySuggestion?ApplyRule:string=");
if(m_bGrammarResults)
sCommandString += "Grammar_";
else if (m_xSpellAlt.is())
@@ -713,7 +714,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
if (MN_SUGGESTION_START <= nId && nId <= MN_SUGGESTION_END)
{
- OUString sApplyRule("Replace_");
+ OUString sApplyRule("");
if(m_bGrammarResults)
sApplyRule += "Grammar_";
else if (m_xSpellAlt.is())
@@ -721,7 +722,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
sApplyRule += m_xPopupMenu->GetItemText(nId);
SfxStringItem aApplyItem(FN_PARAM_1, sApplyRule);
- m_pSh->GetView().GetViewFrame()->GetDispatcher()->ExecuteList(SID_APPLY_SPELLCHECKING, SfxCallMode::SYNCHRON, { &aApplyItem });
+ m_pSh->GetView().GetViewFrame()->GetDispatcher()->ExecuteList(SID_SPELLCHECK_APPLY_SUGGESTION, SfxCallMode::SYNCHRON, { &aApplyItem });
}
else if(MN_AUTOCORR_START <= nId && nId <= MN_AUTOCORR_END)
{
@@ -795,13 +796,13 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
}
else if (nId == MN_IGNORE_SELECTION)
{
- SfxStringItem aIgnoreString(FN_PARAM_1, m_bGrammarResults ? OUString("Ignore_Grammar") : OUString("Ignore_Spelling"));
- m_pSh->GetView().GetViewFrame()->GetDispatcher()->ExecuteList(SID_APPLY_SPELLCHECKING, SfxCallMode::SYNCHRON, { &aIgnoreString });
+ SfxStringItem aIgnoreString(FN_PARAM_1, m_bGrammarResults ? OUString("Grammar") : OUString("Spelling"));
+ m_pSh->GetView().GetViewFrame()->GetDispatcher()->ExecuteList(SID_SPELLCHECK_IGNORE, SfxCallMode::SYNCHRON, { &aIgnoreString });
}
else if (nId == m_nIgnoreWordId)
{
- SfxStringItem aIgnoreString(FN_PARAM_1, m_bGrammarResults ? OUString("IgnoreAll_Grammar") : OUString("IgnoreAll_Spelling"));
- m_pSh->GetView().GetViewFrame()->GetDispatcher()->ExecuteList(SID_APPLY_SPELLCHECKING, SfxCallMode::SYNCHRON, { &aIgnoreString });
+ SfxStringItem aIgnoreString(FN_PARAM_1, m_bGrammarResults ? OUString("Grammar") : OUString("Spelling"));
+ m_pSh->GetView().GetViewFrame()->GetDispatcher()->ExecuteList(SID_SPELLCHECK_IGNORE_ALL, SfxCallMode::SYNCHRON, { &aIgnoreString });
}
else if ((MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) || nId == m_nAddId)
{
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 30c5607e51b6..6cc1d1d7b0c8 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1434,55 +1434,57 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
}
break;
- case SID_APPLY_SPELLCHECKING:
+ case SID_SPELLCHECK_IGNORE:
{
- OUString sApplyText;
- const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
- if (pItem2)
- sApplyText = pItem2->GetValue();
+ // If there is not selection, we need to create one, before ignoring
+ if(!rWrtSh.HasSelection())
+ {
+ OUString sApplyText;
+ const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
+ if (pItem2)
+ sApplyText = pItem2->GetValue();
- const OUString sIgnorePrefix("Ignore_");
- const OUString sIgnoreAllPrefix("IgnoreAll_");
- const OUString sSpellingRule("Spelling");
- const OUString sGrammarRule("Grammar");
- const OUString aReplacePrefix("Replace_");
+ const OUString sGrammarType("Grammar");
+ const OUString sSpellingType("Spelling");
- // Ignore the word at the cursor pos
- sal_Int32 nPos = 0;
- if (-1 != (nPos = sApplyText.indexOf( sIgnorePrefix )))
- {
- if(!rWrtSh.HasSelection())
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list