[Libreoffice-commits] core.git: 2 commits - cui/inc sc/source

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 16 13:14:12 UTC 2019


 cui/inc/tipoftheday.hrc        |    7 +++++--
 sc/source/ui/inc/gridwin.hxx   |    1 +
 sc/source/ui/unoobj/docuno.cxx |    3 ++-
 sc/source/ui/view/gridwin.cxx  |   35 ++++++++++++++++++++++++++++++++++-
 4 files changed, 42 insertions(+), 4 deletions(-)

New commits:
commit d1064efc84c151630c0294a92b4caa08be676d8b
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Mon Dec 9 15:40:24 2019 +0000
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Dec 16 14:13:23 2019 +0100

    lok: calc - update our version of the other view's selections on zoom.
    
    Change-Id: I4d23bb77045b41d04109e7dd70a1f47bca8aaa56
    Reviewed-on: https://gerrit.libreoffice.org/84767
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/84768
    Tested-by: Jenkins

diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index faea326a7cc1..f66e419ebc9c 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -440,6 +440,7 @@ public:
     void updateKitCellCursor(const SfxViewShell* pOtherShell) const;
     /// notify this view with new positions for other view's cursors (after zoom)
     void updateKitOtherCursors() const;
+    void updateOtherKitSelections() const;
 
     /// Same as MouseButtonDown(), but coordinates are in logic unit.
     virtual void LogicMouseButtonDown(const MouseEvent& rMouseEvent) override;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index cae9343550f6..7877fdd30bcf 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -887,8 +887,9 @@ void ScModelObj::setClientZoom(int nTilePixelWidth_, int nTilePixelHeight_, int
     pViewData->SetZoom(Fraction(nTilePixelWidth_ * TWIPS_PER_PIXEL, nTileTwipWidth_),
                        Fraction(nTilePixelHeight_ * TWIPS_PER_PIXEL, nTileTwipHeight_), true);
 
-    // refresh our view's take on other view's cursors
+    // refresh our view's take on other view's cursors & selections
     pViewData->GetActiveWin()->updateKitOtherCursors();
+    pViewData->GetActiveWin()->updateOtherKitSelections();
 }
 
 OUString ScModelObj::getRowColumnHeaders(const tools::Rectangle& rRectangle)
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index b358d9605caf..28fbef5fb1f7 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5910,7 +5910,7 @@ static OString rectanglesToString(const std::vector<tools::Rectangle> &rLogicRec
 }
 
 /**
- * Turn the selection ranges rRectangles into the LibreOfficeKit selection, and call the callback.
+ * Turn the selection ranges rRectangles into the LibreOfficeKit selection, and send to other views.
  *
  * @param pLogicRects - if set then don't invoke the callback, just collect the rectangles in the pointed vector.
  */
@@ -5956,6 +5956,39 @@ void ScGridWindow::UpdateKitSelection(const std::vector<tools::Rectangle>& rRect
     }
 }
 
+/**
+ * Fetch the selection ranges for other views into the LibreOfficeKit selection,
+ * map them into our view co-ordinates and send to our view.
+ */
+void ScGridWindow::updateOtherKitSelections() const
+{
+    ScTabViewShell* pViewShell = pViewData->GetViewShell();
+
+    for (SfxViewShell* it = SfxViewShell::GetFirst(); it;
+         it = SfxViewShell::GetNext(*it))
+    {
+        auto pOther = dynamic_cast<const ScTabViewShell *>(it);
+        assert(pOther);
+        if (!pOther)
+            return;
+
+        // Fetch pixels & convert for each view separately.
+        tools::Rectangle aBoundingBox;
+        std::vector<tools::Rectangle> aPixelRects;
+        GetPixelRectsFor(pOther->GetViewData().GetMarkData() /* theirs */, aPixelRects);
+        auto aOtherLogicRects = convertPixelToLogical(&pViewShell->GetViewData(), aPixelRects, aBoundingBox);
+        OString aRectsString = rectanglesToString(aOtherLogicRects);
+        if (it == pViewShell)
+        {
+            pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_SELECTION_AREA, aBoundingBox.toString().getStr());
+            pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, aRectsString.getStr());
+        }
+        else
+            SfxLokHelper::notifyOtherView(it, pViewShell, LOK_CALLBACK_TEXT_VIEW_SELECTION,
+                                          "selection", aRectsString.getStr());
+    }
+}
+
 namespace
 {
 
commit 6c844f9bbc76f615d9a49526670538f045d82e0b
Author:     Seth Chaiklin <sdc.blanco at youmail.dk>
AuthorDate: Wed Dec 11 16:51:25 2019 +0100
Commit:     Heiko Tietze <heiko.tietze at documentfoundation.org>
CommitDate: Mon Dec 16 14:03:56 2019 +0100

    tdf#127294 replace one section tip of the day with 4 new section tips
    
    Also adjusted wording on another section tip.
    
    Change-Id: I8e24656f2cbf86a5da3bc2b8e204b2bc8d29b33c
    Reviewed-on: https://gerrit.libreoffice.org/84965
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tietze at documentfoundation.org>

diff --git a/cui/inc/tipoftheday.hrc b/cui/inc/tipoftheday.hrc
index cd3de91041a7..5847985b714e 100644
--- a/cui/inc/tipoftheday.hrc
+++ b/cui/inc/tipoftheday.hrc
@@ -69,12 +69,14 @@ const std::tuple<const char*, OUString, OUString> TIPOFTHEDAY_STRINGARRAY[] =
      { NC_("RID_CUI_TIPOFTHEDAY", "Use Page/Slide > Properties > 'Fit object to paper format' in Draw/Impress to resize the objects so that they fit on your chosen paper format."), "", "tipoftheday_d.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "Fit the entire page in a Draw window, use * on the number pad."), "", "tipoftheday_d.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "In a Draw page, use '-' to zoom out; '+' to zoom in."), "", "tipoftheday_d.png"},
+     { NC_("RID_CUI_TIPOFTHEDAY", "Want to show the contents of another document within your document? Use Insert ▸ Section and select Link."), "modules/swriter/ui/editsectiondialog/link", "tipoftheday_w.png"}, // https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/swriter/guide/section_insert.html#par_id3153404
      { NC_("RID_CUI_TIPOFTHEDAY", "To automatically number your table rows in Writer, select the relevant column, then apply a numbering style from List Styles."), "", "tipoftheday_w.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "%PRODUCTNAME allows you to use assistive tools, such as external screen readers, Braille devices or speech recognition input devices."), "https://www.libreoffice.org/get-help/accessibility/", ""},
      { NC_("RID_CUI_TIPOFTHEDAY", "Want to sort a series in %PRODUCTNAME Calc such as A1, A2, A3, A11, A15, not in alphabetical order but on the number? Enable natural sort in the Options tab."), "modules/scalc/ui/sortoptionspage/SortOptionsPage", "tipoftheday_c.png"}, //https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/scalc/01/12030200.html
      { NC_("RID_CUI_TIPOFTHEDAY", "You can change the default function in the status bar: right click on the area."), "", "tipoftheday_c.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "Want to add many of the same shapes in Draw/Impress? Double-click a tool in the drawing toolbar to use it for repeated tasks."), "", "tipoftheday_d.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "Ctrl+Shift+F9 recalculates all formulas in all spreadsheets."), "", "tipoftheday_c.png"},
+     { NC_("RID_CUI_TIPOFTHEDAY", "Want to keep a part of an editable document as read-only? Insert ▸ Section. Add text to the section, then right-click “Edit Section” and check “Protect”."), "", "tipoftheday_w.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "Use the Backspace key instead of Delete in Calc. You can choose what to delete."), "", "tipoftheday_c.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "Best way to fix bad-looking MS Word table cells via Table > Size > Optimal Row Height / Column Width."), "", "tipoftheday_w.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "To repeat a table heading when a table spans over a page, use Table > Table Properties > Text Flow > Repeat heading."), "", "tipoftheday_w.png"},
@@ -85,7 +87,6 @@ const std::tuple<const char*, OUString, OUString> TIPOFTHEDAY_STRINGARRAY[] =
      { NC_("RID_CUI_TIPOFTHEDAY", "Insert your metadata in your document with Insert > Fields > More Fields… > Document or DocInformation."), "", "tipoftheday_w.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "Get help from the community via the Ask portal."), "https://ask.libreoffice.org", ""},
      { NC_("RID_CUI_TIPOFTHEDAY", "Use Shift+Space to select the current row and Ctrl+Space to select the current column."), "", "tipoftheday_c.png"},
-     { NC_("RID_CUI_TIPOFTHEDAY", "Use Sections in %PRODUCTNAME Writer to protect part of a text, show/hide text, reuse parts from other documents, use different column layout."), "modules/swriter/ui/sectionpage/SectionPage", "tipoftheday_w.png"}, //https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/swriter/01/04020100.html
      { NC_("RID_CUI_TIPOFTHEDAY", "You can move an object to another layer by holding it until its edges flash, then drag it to the tab of the layer you want to move it to."), "", "tipoftheday_d.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "Data > Validity allows you to create drop-down lists where the user selects a value instead of typing."), "https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/scalc/guide/validity.html", "tipoftheday_c.png"}, //local help missing
      { NC_("RID_CUI_TIPOFTHEDAY", "Hold down Ctrl and turn the mouse wheel to change the zoom factor."), "", ""},
@@ -117,6 +118,7 @@ const std::tuple<const char*, OUString, OUString> TIPOFTHEDAY_STRINGARRAY[] =
      { NC_("RID_CUI_TIPOFTHEDAY", "Need to precisely position? Alt+arrow Keys move objects (shapes, pictures, formulas) by one pixel."), "", "tipoftheday_d.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "Embedded help is available by pressing F1, if you've installed it. Otherwise check online at:"), "https://help.libreoffice.org", ""},
      { NC_("RID_CUI_TIPOFTHEDAY", "Right-click in the status bar in %PRODUCTNAME Calc and select 'Selection count' to display the number of selected cells."), "", "tipoftheday_c.png"},
+     { NC_("RID_CUI_TIPOFTHEDAY", "Want to have two or more columns for just a part of a %PRODUCTNAME Writer page? Insert ▸ Section, set with Columns tab, and place text in that section."), "", "tipoftheday_w.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "Use Data > Statistics for sampling, descriptive statistics, analysis of variance, correlation, and much more in %PRODUCTNAME Calc."), "", "tipoftheday_c.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "You can copy from one sheet to another without the clipboard. Select the area to copy, Ctrl+click the target sheet's tab and use Sheet > Fill Cells > Fill Sheets."), "", "tipoftheday_c.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "You can change the look of %PRODUCTNAME via Tools > Options > View > User Interface."), "", ""},
@@ -148,6 +150,7 @@ const std::tuple<const char*, OUString, OUString> TIPOFTHEDAY_STRINGARRAY[] =
      { NC_("RID_CUI_TIPOFTHEDAY", "Your Writer document didn’t reopen with the text cursor at the same editing position it was when you saved it? Check Tools > Options > %PRODUCTNAME > User Data > First/Last name is not empty."), "", ""},
      { NC_("RID_CUI_TIPOFTHEDAY", "Citation management? Use a 3rd party extension."), "https://wiki.documentfoundation.org/Referencing_Systems_in_LibreOffice", ""},
      { NC_("RID_CUI_TIPOFTHEDAY", "Want to insert a value in the same place on several sheets? Select the sheets: hold down Ctrl key and click their tabs before entering."), "", "tipoftheday_c.png"},
+     { NC_("RID_CUI_TIPOFTHEDAY", "Want to hide some text in a document? Select the text. Insert ▸ Section, and select “Hide”."), "modules/swriter/ui/editsectiondialog/hide", "tipoftheday_w.png"},  // online help is different https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/swriter/guide/hidden_text.html#hd_id3148675
      { NC_("RID_CUI_TIPOFTHEDAY", "You can customize the middle mouse button per Tools > Options > %PRODUCTNAME > View > Middle Mouse button."), "", ""},
      { NC_("RID_CUI_TIPOFTHEDAY", "Want to print two portrait pages on a landscape one (reducing A4 to A5)? File > Print and select 2 at ‘Pages per sheet’."), "", ""},
      { NC_("RID_CUI_TIPOFTHEDAY", "For quick access to your document bookmarks, right-click on the page number of the status bar (lower-left corner of document window)."), "", "tipoftheday_w.png"},
@@ -239,7 +242,7 @@ const std::tuple<const char*, OUString, OUString> TIPOFTHEDAY_STRINGARRAY[] =
      { NC_("RID_CUI_TIPOFTHEDAY", "Uncheck Slide Show > Settings > Presentation always on top if you need another program displays its window to the front of your presentation."), "", "tipoftheday_i.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "Want to find the words in bold in a Writer document? Edit > Find & Replace > Other options > Attributes > Font weight."), "https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/swriter/guide/finding.html", "tipoftheday_w.png"}, //local help missing
      { NC_("RID_CUI_TIPOFTHEDAY", "You can sort paragraphs or table rows alphabetically or numerically per Tools > Sort."), "modules/swriter/ui/sortdialog/SortDialog", "tipoftheday_w.png"}, //https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/swriter/01/06100000.html
-     { NC_("RID_CUI_TIPOFTHEDAY", "Click at the beginning (end) of a section and press Alt+Enter to insert a paragraph before (after) the section."), "", "tipoftheday_w.png"},
+     { NC_("RID_CUI_TIPOFTHEDAY", "To insert a paragraph before (after) a section, press Alt+Enter at the beginning (end) of the section."), "", "tipoftheday_w.png"},
      { NC_("RID_CUI_TIPOFTHEDAY", "%PRODUCTNAME has a template center to create good looking documents - check it out."), "http://templates.libreoffice.org/template-center", ""},
      { NC_("RID_CUI_TIPOFTHEDAY", "Calculate loan repayments with Calc: eg. PMT(2%/12;36;2500) interest rate per payment period 2%/12, 36 months, loan amount 2500."), "https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/scalc/01/04060119.html?DbPAR=CALC#bm_id3149577", "tipoftheday_c.png"}, //local help missing
      { NC_("RID_CUI_TIPOFTHEDAY", "Cannot find what you want with the VLOOKUP function in Calc? With INDEX and MATCH you can do everything!"), "https://help.libreoffice.org/%PRODUCTVERSION/%LANGUAGENAME/text/scalc/01/04060109.html", "tipoftheday_c.png"}, //local help missing


More information about the Libreoffice-commits mailing list