include/svtools/ctrlbox.hxx                  |    1 
 sc/source/ui/docshell/docsh.cxx              |   29 ++++++++++++++++-----------
 sc/source/ui/view/gridwin.cxx                |    7 ++++++
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   16 +-------------
 svx/source/dialog/weldeditview.cxx           |    5 +++-
 svx/source/svdraw/svdxcgv.cxx                |    5 +++-
 svx/source/tbxctrls/tbcontrl.cxx             |    5 +++-
 vcl/source/bitmap/bitmappaint.cxx            |    6 ++---
 8 files changed, 43 insertions(+), 31 deletions(-)

New commits:
commit 5b960f396a0fa3ef63825424d90e468ccb156abf
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Jan 19 12:00:21 2022 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Feb 21 22:04:08 2022 +0100

    lok: fix regression "WeldEditView::DoPaint" for dialog tunneling
    
    Change-Id: I1cb345b3911d03dc90acef2a17705d654a06deb0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128622
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/svx/source/dialog/weldeditview.cxx 
b/svx/source/dialog/weldeditview.cxx
index 341a7cc58a67..f645349661fb 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -26,6 +26,7 @@
 #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
+#include <comphelper/lok.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
 #include <drawinglayer/processor2d/processor2dtools.hxx>
@@ -178,7 +179,9 @@ void WeldEditView::DoPaint(vcl::RenderContext& 
rRenderContext, const tools::Rect
 
     if (EditView* pEditView = GetEditView())
     {
-        pEditView->Paint(rRect, &rRenderContext);
+        pEditView->Paint(comphelper::LibreOfficeKit::isActive() ? 
rRenderContext.PixelToLogic(rRect)
+                                                                : rRect,
+                         &rRenderContext);
 
         if (HasFocus())
         {
commit 4197b71ed8c95fc42ff384a4fcab563b67664967
Author:     Mert Tumer <mert.tu...@collabora.com>
AuthorDate: Wed Jan 19 14:23:52 2022 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Feb 21 22:01:40 2022 +0100

    lok: Set pasted text rect pos to 0, 0
    
    Rect size change according to the length of the text
    however, this can make the text inserted in the negative coordinates
    and half of it becomes invisible.
    
    Signed-off-by: Mert Tumer <mert.tu...@collabora.com>
    Change-Id: Ibd4e6164c21088205efecf024c1888c55ac33f0e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128603
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 571eafb0b08c..3a449e76004d 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2472,21 +2472,9 @@ void SdTiledRenderingTest::testPasteTextOnSlide()
     SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>(pObject);
     CPPUNIT_ASSERT(pTextObj);
     CPPUNIT_ASSERT_EQUAL(OBJ_TEXT, pTextObj->GetObjIdentifier());
-    // This test is unreliable: it gives alternating results for the following 
coordinates.
-    // As a compromise, instead of disabling it altogether, we allow for both 
sets of values.
     const Point aPos = pTextObj->GetLastBoundRect().TopLeft();
-    if (aPos.getX() < 10000)
-    {
-        // We get this with 'make CppunitTest_sd_tiledrendering'
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<tools::Long>(6739), 
aPos.getX(), 100);
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<tools::Long>(6822), 
aPos.getY(), 100);
-    }
-    else
-    {
-        // We get this with 'make check'
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<tools::Long>(12990), 
aPos.getX(), 100);
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<tools::Long>(7393), 
aPos.getY(), 100);
-    }
+    CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(0), aPos.getX());
+    CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(0), aPos.getY());
 }
 
 void SdTiledRenderingTest::testTdf115873()
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index bdbf568c753d..9a2ca91a2c92 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -48,6 +48,7 @@
 #include <svx/sdr/contact/displayinfo.hxx>
 #include <svx/svdotable.hxx>
 #include <sal/log.hxx>
+#include <comphelper/lok.hxx>
 
 using namespace com::sun::star;
 
@@ -404,7 +405,9 @@ void SdrExchangeView::ImpPasteObject(SdrObject* pObj, 
SdrObjList& rLst, const Po
     nSizY /= aDstFr.GetNumerator();
     tools::Long xs=nSizX;
     tools::Long ys=nSizY;
-    Point aPos(rCenter.X()-xs/2,rCenter.Y()-ys/2);
+    // set the pos to 0, 0 for online case
+    bool isLOK = comphelper::LibreOfficeKit::isActive();
+    Point aPos(isLOK ? 0 : rCenter.X()-xs/2, isLOK ? 0 : rCenter.Y()-ys/2);
     tools::Rectangle aR(aPos.X(),aPos.Y(),aPos.X()+xs,aPos.Y()+ys);
     pObj->SetLogicRect(aR);
     rLst.InsertObject(pObj, SAL_MAX_SIZE);
commit 0a31e12cbb878549683da798ffd0b57197bdcf29
Author:     Mert Tumer <mert.tu...@collabora.com>
AuthorDate: Tue Jan 18 12:57:16 2022 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Feb 21 22:01:34 2022 +0100

    set active element to -1 when no selection for fontnamebox
    
    FontNameBox sets the currentVal to emptystring when there's
    a mixed font-name selection on the text but does not update
    the active_element which is incorrect whereas other comboboxes such
    as FontSize does it correctly.
    
    Signed-off-by: Mert Tumer <mert.tu...@collabora.com>
    Change-Id: Iff86bba64c2ab564ff5c5fa979eb846af9651a11
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128551
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx
index 28730d16e85a..ca45b081cf5a 100644
--- a/include/svtools/ctrlbox.hxx
+++ b/include/svtools/ctrlbox.hxx
@@ -368,6 +368,7 @@ public:
     int get_active() const { return m_xComboBox->get_active(); }
     OUString get_active_text() const { return m_xComboBox->get_active_text(); }
     void set_active_or_entry_text(const OUString& rText);
+    void set_active(int nPos) { m_xComboBox->set_active(nPos); }
     int get_count() const { return m_xComboBox->get_count(); }
     OUString get_text(int nIndex) const { return 
m_xComboBox->get_text(nIndex); }
     void set_sensitive(bool bSensitive) { 
m_xComboBox->set_sensitive(bSensitive); }
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 2946bea56c21..465b96c13106 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3099,8 +3099,11 @@ void SvxFontNameBox_Base::statusChanged_Impl( const 
css::frame::FeatureStateEven
         css::awt::FontDescriptor aFontDesc;
         if ( rEvent.State >>= aFontDesc )
             Update(&aFontDesc);
-        else
+        else {
+            // no active element; delete value in the display
+            m_xWidget->set_active(-1);
             set_active_or_entry_text("");
+        }
         m_xWidget->save_value();
     }
 }
commit 79d3c5675dc52742997ce60bb1d6b6d5ccaa0fd3
Author:     Mert Tumer <mert.tu...@collabora.com>
AuthorDate: Wed Jan 12 19:02:23 2022 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Feb 21 22:01:28 2022 +0100

    lok: remove residue text selection when there's none in the core
    
    Residue selection can stay at the browser even after changing the 
cellcursor pos
    make sure to clean it up if there is no selection rectangle in reality
    to be synced with core.
    
    Signed-off-by: Mert Tumer <mert.tu...@collabora.com>
    Change-Id: I1b06b6ec84ae195936d12dc986ef4a19b26dbc8f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128351
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Tested-by: Henry Castro <hcas...@collabora.com>
    Reviewed-by: Henry Castro <hcas...@collabora.com>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 09cee6b08db8..eced196db277 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5921,6 +5921,13 @@ void ScGridWindow::notifyKitCellCursor() const
     pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_CURSOR, 
getCellCursor().getStr());
     if (bListValButton && aListValPos == mrViewData.GetCurPos())
         updateLOKValListButton(true, aListValPos);
+    std::vector<tools::Rectangle> aRects;
+    GetSelectionRects(aRects);
+    if (aRects.empty() || !mrViewData.IsActive())
+    {
+        pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, 
"");
+        SfxLokHelper::notifyOtherViews(pViewShell, 
LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", "EMPTY");
+    }
 }
 
 void ScGridWindow::notifyKitCellViewCursor(const SfxViewShell* pForShell) const
commit d8901351d488af0a502b8a41137529060e1b4a20
Author:     Mert Tumer <mert.tu...@collabora.com>
AuthorDate: Wed Dec 29 16:34:38 2021 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Feb 21 22:01:19 2022 +0100

    LOK android: Fix csv sheet name becomes temp name
    
    Signed-off-by: Mert Tumer <mert.tu...@collabora.com>
    Change-Id: If43d7a995a5e53734fc7ecdcbf9b750b4886dc45
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127684
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 4a13484c82cf..6b61031e021f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -136,6 +136,8 @@
 #include <memory>
 #include <vector>
 
+#include <comphelper/lok.hxx>
+
 using namespace com::sun::star;
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::lang::XMultiServiceFactory;
@@ -1291,17 +1293,22 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     sc::SetFormulaDirtyContext aCxt;
                     m_aDocument.SetAllFormulasDirty(aCxt);
 
-                    // The same resulting name has to be handled in
-                    // ScExternalRefCache::initializeDoc() and related, hence
-                    // pass 'true' for RenameTab()'s bExternalDocument for a
-                    // composed name so ValidTabName() will not be checked,
-                    // which could veto the rename in case it contained
-                    // characters that Excel does not handle. If we wanted to
-                    // change that then it needed to be handled in all
-                    // corresponding places of the external references
-                    // manager/cache. Likely then we'd also need a method to
-                    // compose a name excluding such characters.
-                    m_aDocument.RenameTab( 0, INetURLObject( 
rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
+                    bool bIsMobile = comphelper::LibreOfficeKit::isActive() && 
SfxViewShell::Current()
+                        && SfxViewShell::Current()->isLOKMobilePhone();
+                    // for mobile case, we use a copy of the original document 
and give it a temporary name before editing
+                    // Therefore, the sheet name becomes ugly, long and 
nonsensical.
+                    if (!bIsMobile)
+                        // The same resulting name has to be handled in
+                        // ScExternalRefCache::initializeDoc() and related, 
hence
+                        // pass 'true' for RenameTab()'s bExternalDocument for 
a
+                        // composed name so ValidTabName() will not be checked,
+                        // which could veto the rename in case it contained
+                        // characters that Excel does not handle. If we wanted 
to
+                        // change that then it needed to be handled in all
+                        // corresponding places of the external references
+                        // manager/cache. Likely then we'd also need a method 
to
+                        // compose a name excluding such characters.
+                        m_aDocument.RenameTab( 0, INetURLObject( 
rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
 
                     bOverflowRow = aImpEx.IsOverflowRow();
                     bOverflowCol = aImpEx.IsOverflowCol();
commit 548dbd527ec1e32b6d886add4d5e5832be0eb62f
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Sat Feb 5 19:01:08 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Feb 21 22:01:00 2022 +0100

    Fix Bitmap::Rotate
    
    Bug introduced in:
        commit 74c46b12340f1afb1752f5df0bab91caca3ef63f
        speed up bitmap rotation
    
    it was showing some artifacts in LOK when using previews in rotation
    -> sin and cos values were used incorrectly
    
    Change-Id: Id85c54d0aa4488f19e7b5db2e242fdb446626699
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129528
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/vcl/source/bitmap/bitmappaint.cxx 
b/vcl/source/bitmap/bitmappaint.cxx
index 954820c761cc..22a2bfdbd92f 100644
--- a/vcl/source/bitmap/bitmappaint.cxx
+++ b/vcl/source/bitmap/bitmappaint.cxx
@@ -378,7 +378,7 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& 
rFillColor)
 
                     for (sal_Int32 nIdx = 0, nX = 0; nX < nNewWidth; nX++)
                     {
-                        const float fTmp = (fXMin + nX) * 64;
+                        const double fTmp = (fXMin + nX) * 64;
 
                         pCosSinX[nIdx++] = std::round(fCosAngle * fTmp);
                         pCosSinX[nIdx++] = std::round(fSinAngle * fTmp);
@@ -386,7 +386,7 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& 
rFillColor)
 
                     for (sal_Int32 nIdx = 0, nY = 0; nY < nNewHeight; nY++)
                     {
-                        const float fTmp = (fYMin + nY) * 64;
+                        const double fTmp = (fYMin + nY) * 64;
 
                         pCosSinY[nIdx++] = std::round(fCosAngle * fTmp);
                         pCosSinY[nIdx++] = std::round(fSinAngle * fTmp);
@@ -394,8 +394,8 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& 
rFillColor)
 
                     for (sal_Int32 nCosSinYIdx = 0, nY = 0; nY < nNewHeight; 
nY++)
                     {
-                        sal_Int32 nSinY = pCosSinY[nCosSinYIdx++];
                         sal_Int32 nCosY = pCosSinY[nCosSinYIdx++];
+                        sal_Int32 nSinY = pCosSinY[nCosSinYIdx++];
                         Scanline pScanline = pWriteAcc->GetScanline(nY);
 
                         for (sal_Int32 nCosSinXIdx = 0, nX = 0; nX < 
nNewWidth; nX++)

Reply via email to