[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - 4 commits - editeng/source include/LibreOfficeKit sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue May 26 00:35:42 PDT 2015
editeng/source/editeng/impedit.cxx | 4 ++--
editeng/source/editeng/impedit2.cxx | 4 ++--
include/LibreOfficeKit/LibreOfficeKitEnums.h | 10 +++++++++-
sw/source/core/crsr/findtxt.cxx | 7 +++++--
sw/source/uibase/uiview/view2.cxx | 2 ++
5 files changed, 20 insertions(+), 7 deletions(-)
New commits:
commit 3224c2ad9ee16d3d437aa30cff68d6016a25549d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat May 23 10:43:41 2015 +0100
SwView::UpdatePageNums: add LOK callback about page count change
Change-Id: If9ab69c9f3ec3f9f518738792ff020ef4cfd6390
(cherry picked from commit fb2e4da0e20fea3c085ddec899376e7f3671e1b1)
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index ffa2f64..54862e1 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -143,7 +143,15 @@ typedef enum
/**
* No match was found for the search input
*/
- LOK_CALLBACK_SEARCH_NOT_FOUND
+ LOK_CALLBACK_SEARCH_NOT_FOUND,
+
+ /**
+ * Number of pages changed in the document.
+ *
+ * Clients should assume that data returned by an earlier
+ * lok::Document::getDocumentSize() call is no longer valid.
+ */
+ LOK_CALLBACK_PAGE_COUNT_CHANGED
}
LibreOfficeKitCallbackType;
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index b6f947d..a8ce619 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -147,6 +147,7 @@
#include <vcl/settings.hxx>
#include <boost/scoped_ptr.hpp>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
const char sStatusDelim[] = " : ";
const char sStatusComma[] = " , ";
@@ -1280,6 +1281,7 @@ void SwView::Execute(SfxRequest &rReq)
/// invalidate page numbering field
void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr)
{
+ GetWrtShell().libreOfficeKitCallback(LOK_CALLBACK_PAGE_COUNT_CHANGED, 0);
OUString sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr ));
const SfxStringItem aTmp( FN_STAT_PAGE, sTemp );
// Used to distinguish which tooltip to show
commit 57840bb2030bdd3d4d4fa41dd77ee4069e854486
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed May 20 16:56:45 2015 +0200
SwPaM::Find: forgot to show the cursor after ending the text edit
Without this, if you searched inside a shape, then got a next hit
outside the shape, you didn't get your blinking cursor even if you
clicked into the writer text.
Change-Id: I053af9672dc9290728b16780f21301b3b840cb55
(cherry picked from commit 1633fb2651e32f3dab5104b11074e7904cdcbec3)
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 9a2a8a1..c15e5d1 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -27,7 +27,7 @@
#include <sfx2/sfxsids.hrc>
#include <editeng/outliner.hxx>
-#include <editsh.hxx>
+#include <wrtsh.hxx>
#include <txatritr.hxx>
#include <fldbas.hxx>
#include <fmtfld.hxx>
@@ -294,7 +294,7 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
}
SwDocShell *const pDocShell = pNode->GetDoc()->GetDocShell();
- SwViewShell *const pWrtShell = (pDocShell) ? pDocShell->GetEditShell() : 0;
+ SwWrtShell *const pWrtShell = (pDocShell) ? pDocShell->GetWrtShell() : 0;
SwPostItMgr *const pPostItMgr = (pWrtShell) ? pWrtShell->GetPostItMgr() : 0;
SvxSearchItem aSearchItem(SID_SEARCH_ITEM);
@@ -311,7 +311,10 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
{
// If not found, end the text edit.
pSdrView->SdrEndTextEdit();
+ const Point aPoint(pSdrView->GetAllMarkedRect().TopLeft());
pSdrView->UnmarkAll();
+ pWrtShell->SetCursor(&aPoint, true);
+ pWrtShell->Edit();
}
else
{
commit b1e1bb2f3c5b32ec8898c006704c3ebacff78bf3
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed May 20 15:26:27 2015 +0200
ImpEditView::SetCursorAtPoint tiled rendering: avoid partial selections
Same problem as in the previous commit, just for mouse move. Previously
when selecting "abc" with the mouse only one or zero letter got selected
as the mouse moved, now it's properly the whole afffected string.
Change-Id: I025dbd71fc02a0c93a532ca188836ffb957d6b35
(cherry picked from commit c6f03d6fc25a3cea22f2ce035d0948bcaa74daa9)
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 676fc44..d1f5d95 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1531,8 +1531,8 @@ bool ImpEditView::SetCursorAtPoint( const Point& rPointPixel )
EditPaM aPaM = pEditEngine->GetPaM(aDocPos);
bool bGotoCursor = DoAutoScroll();
- // aTmpNewSel: Diff between old and new, not the new selection
- EditSelection aTmpNewSel( GetEditSelection().Max(), aPaM );
+ // aTmpNewSel: Diff between old and new, not the new selection, unless tiled rendering
+ EditSelection aTmpNewSel( isTiledRendering() ? GetEditSelection().Min() : GetEditSelection().Max(), aPaM );
// #i27299#
// work on copy of current selection and set new selection, if it has changed.
commit d9ffe9b554b90cddbae2211d94342dc8887c9d57
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed May 20 15:18:30 2015 +0200
ImpEditEngine::MoveCursor tiled rendering: avoid partial selections
Tiled rendering assumes that the whole list of selection rectangles is
sent, i.e. the information is not incremental.
With this, if the text is "abc" and you are before "a" with the cursor,
then pressing shift-rightarrow two times will result in "ab" being
selected, not just "b".
Change-Id: I70c043575d3c68d78342af0a6b78659d83b4f5f4
(cherry picked from commit 18e08580b660111e7e9b0bae18ac9034f57475ba)
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 87a1f94..7905893 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -909,8 +909,8 @@ EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pE
pEditView->pImpEditView->GetEditSelection().Max() = aPaM;
if ( bKeyModifySelection )
{
- // Then the selection is expanded ...
- EditSelection aTmpNewSel( aOldEnd, aPaM );
+ // Then the selection is expanded ... or the whole selection is painted in case of tiled rendering.
+ EditSelection aTmpNewSel( pEditView->isTiledRendering() ? pEditView->pImpEditView->GetEditSelection().Min() : aOldEnd, aPaM );
pEditView->pImpEditView->DrawSelection( aTmpNewSel );
}
else
More information about the Libreoffice-commits
mailing list