[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - 7 commits - desktop/CppunitTest_desktop_lib.mk desktop/qa sc/inc sc/sdi sc/source sw/source
Andras Timar
andras.timar at collabora.com
Sun Jun 12 22:51:31 UTC 2016
desktop/CppunitTest_desktop_lib.mk | 2 +
desktop/qa/data/blank_presentation.odp |binary
desktop/qa/desktop_lib/test_desktop_lib.cxx | 3 ++
sc/inc/address.hxx | 2 +
sc/sdi/scalc.sdi | 2 -
sc/source/core/data/fillinfo.cxx | 23 ++++++++++++-------
sc/source/ui/docshell/impex.cxx | 3 +-
sc/source/ui/unoobj/docuno.cxx | 16 ++++++++++++-
sc/source/ui/view/cellsh3.cxx | 32 +++++++++++++++++++++------
sc/source/ui/view/gridwin.cxx | 8 ++++++
sc/source/ui/view/tabview3.cxx | 4 ++-
sw/source/uibase/uno/SwXDocumentSettings.cxx | 2 -
12 files changed, 78 insertions(+), 19 deletions(-)
New commits:
commit f9ff27f6959ddfc16adbbf4d965458c3633b9747
Author: Andras Timar <andras.timar at collabora.com>
Date: Mon Jun 13 00:37:55 2016 +0200
add desktop/qa/data/blank_presentation.odp
Change-Id: Ib41270d589dfa166cb2fb8d7f14a1caaedf4d4fc
diff --git a/desktop/CppunitTest_desktop_lib.mk b/desktop/CppunitTest_desktop_lib.mk
index 2119e15..75418be 100644
--- a/desktop/CppunitTest_desktop_lib.mk
+++ b/desktop/CppunitTest_desktop_lib.mk
@@ -61,6 +61,8 @@ $(eval $(call gb_CppunitTest_use_components,desktop_lib,\
sw/util/swd \
sc/util/sc \
sc/util/scd \
+ sd/util/sd \
+ sd/util/sdd \
toolkit/util/tk \
ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \
diff --git a/desktop/qa/data/blank_presentation.odp b/desktop/qa/data/blank_presentation.odp
new file mode 100644
index 0000000..157901f
Binary files /dev/null and b/desktop/qa/data/blank_presentation.odp differ
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index e8f6ff4..dc1282f 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -130,6 +130,9 @@ LibLODocument_Impl* DesktopLOKTest::loadDoc(const char* pName, LibreOfficeKitDoc
case LOK_DOCTYPE_SPREADSHEET:
aService = "com.sun.star.sheet.SpreadsheetDocument";
break;
+ case LOK_DOCTYPE_PRESENTATION:
+ aService = "com.sun.star.presentation.PresentationDocument";
+ break;
default:
CPPUNIT_ASSERT(false);
break;
commit c82627a66b00197656f4a0a793b9cf2ce0747a21
Author: Henry Castro <hcastro at collabora.com>
Date: Wed Jun 1 14:24:12 2016 -0400
sc lok: limit movement of the cursor
(cherry picked from commit 538d0c92ae2d5cb36869360a0889bc063a854f47)
Change-Id: Ic7fe2dec012efb8ba180feb4d3df6f4bfbf6c38a
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 8ac565c..4654ced 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -70,6 +70,8 @@ const SCROW MAXROW = MAXROWCOUNT - 1;
const SCCOL MAXCOL = MAXCOLCOUNT - 1;
const SCTAB MAXTAB = MAXTABCOUNT - 1;
const SCCOLROW MAXCOLROW = MAXROW;
+// Maximun tiled rendering values
+const SCROW MAXTILEDROW = 1000;
// Limit the initial tab count to prevent users to set the count too high,
// which could cause the memory usage of blank documents to exceed the
// available system memory.
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 2f74bbb..d19d90d 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -138,6 +138,7 @@
#define LOK_USE_UNSTABLE_API
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <comphelper/lok.hxx>
#include <memory>
#include <vector>
@@ -1979,6 +1980,13 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt, MouseEventSta
pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nPosX, nPosY );
SCTAB nTab = pViewData->GetTabNo();
+ if ( comphelper::LibreOfficeKit::isActive() && nPosY > MAXTILEDROW - 1 )
+ {
+ nButtonDown = 0;
+ nMouseStatus = SC_GM_NONE;
+ return;
+ }
+
// Auto filter / pivot table / data select popup. This shouldn't activate the part.
if ( !bDouble && !bFormulaMode && rMEvt.IsLeft() )
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 0e592b4..bc0581d 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -62,6 +62,8 @@
#include "tabprotection.hxx"
#include "markdata.hxx"
#include <formula/FormulaCompiler.hxx>
+#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <com/sun/star/chart2/data/HighlightedRange.hpp>
@@ -976,7 +978,7 @@ void ScTabView::MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode,
if (nCurX < 0) nCurX = 0;
if (nCurY < 0) nCurY = 0;
if (nCurX > MAXCOL) nCurX = MAXCOL;
- if (nCurY > MAXROW) nCurY = MAXROW;
+ nCurY = std::min(nCurY, comphelper::LibreOfficeKit::isActive() ? MAXTILEDROW - 1 : MAXROW);
HideAllCursors();
commit b8efab44b2777a6763e291d03abd4906171d2735
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Mar 27 00:30:09 2016 +0100
extract function from ScDocument::FillInfo
A first step in breaking the function into smaller pieces.
Change-Id: I94aeb11fd9c44a7eaa198cb39f208b574ef2758d
Reviewed-on: https://gerrit.libreoffice.org/23548
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
(cherry picked from commit efea43b4c4f42023a540079866b065068ae8a8e5)
Reviewed-on: https://gerrit.libreoffice.org/25280
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
(cherry picked from commit 16c3defa8ff6330e4c21ba42177d92665a67ac0b)
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index 89c81a6..33319cb 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -195,6 +195,20 @@ public:
}
};
+bool isRotateItemUsed(ScDocumentPool *pPool)
+{
+ sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE );
+ for (sal_uInt32 nItem=0; nItem<nRotCount; nItem++)
+ {
+ if (pPool->GetItem2( ATTR_ROTATE_VALUE, nItem ))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
}
void ScDocument::FillInfo(
@@ -312,14 +326,7 @@ void ScDocument::FillInfo(
// Rotated text...
// Is Attribute really used in document?
- bool bAnyItem = false;
- sal_uInt32 nRotCount = pPool->GetItemCount2( ATTR_ROTATE_VALUE );
- for (sal_uInt32 nItem=0; nItem<nRotCount; nItem++)
- if (pPool->GetItem2( ATTR_ROTATE_VALUE, nItem ))
- {
- bAnyItem = true;
- break;
- }
+ bool bAnyItem = isRotateItemUsed(pPool);
SCCOL nRotMax = nCol2;
if ( bAnyItem && HasAttrib( 0,nRow1,nTab, MAXCOL,nRow2+1,nTab,
commit 6fe0149c78e2d76fe4ee284b153e593176e39cb0
Author: Pranav Kant <pranavk at collabora.com>
Date: Wed Jun 1 12:58:30 2016 +0530
sc lok: Add new param to .uno:EnterString to prevent committing
If new param, DontCommit, is specified start the edit engine and
edit the current cell. This helps in not triggering calculations
that depend on the current cell. In case DontCommit param is
missing, it will work as it used to.
Change-Id: I62408932e52ff68fa11568cfc16a43e4c1e919c5
Reviewed-on: https://gerrit.libreoffice.org/25753
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: pranavk <pranavk at collabora.com>
(cherry picked from commit c14627d66ca8d9fe14272fadb5305857101f513e)
Reviewed-on: https://gerrit.libreoffice.org/25788
Tested-by: pranavk <pranavk at collabora.com>
(cherry picked from commit 4b2c9e9b6641160829af143885fda48a78a2a3a7)
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index 4746117..f1a7225 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -9046,7 +9046,7 @@ SfxVoidItem Ungroup SID_OUTLINE_REMOVE
]
SfxVoidItem EnterString SID_ENTER_STRING
-(SfxStringItem StringName SID_ENTER_STRING)
+(SfxStringItem StringName SID_ENTER_STRING,SfxBoolItem DontCommit FN_PARAM_1)
[
/* flags: */
AutoUpdate = FALSE,
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index d2fd259..132fe93 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -18,6 +18,8 @@
*/
#include "scitems.hxx"
+#include <editeng/editview.hxx>
+#include <editeng/editeng.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
@@ -177,19 +179,37 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
OUString aStr( static_cast<const SfxStringItem&>(pReqArgs->
Get( SID_ENTER_STRING )).GetValue() );
-
- pTabViewShell->EnterData( GetViewData()->GetCurX(),
- GetViewData()->GetCurY(),
- GetViewData()->GetTabNo(),
- aStr );
+ const SfxPoolItem* pDontCommitItem;
+ bool bCommit = true;
+ if (pReqArgs->HasItem(FN_PARAM_1, &pDontCommitItem))
+ bCommit = !(static_cast<const SfxBoolItem*>(pDontCommitItem)->GetValue());
ScInputHandler* pHdl = SC_MOD()->GetInputHdl( pTabViewShell );
+ if (bCommit)
+ {
+ pTabViewShell->EnterData( GetViewData()->GetCurX(),
+ GetViewData()->GetCurY(),
+ GetViewData()->GetTabNo(),
+ aStr );
+ }
+ else
+ {
+ SC_MOD()->SetInputMode(SC_INPUT_TABLE);
+
+ EditView* pTableView = pHdl->GetActiveView();
+ pHdl->DataChanging();
+ if (pTableView)
+ pTableView->GetEditEngine()->SetText(aStr);
+ pHdl->DataChanged();
+
+ SC_MOD()->SetInputMode(SC_INPUT_NONE);
+ }
+
if ( !pHdl || !pHdl->IsInEnterHandler() )
{
// UpdateInputHandler is needed after the cell content
// has changed, but if called from EnterHandler, UpdateInputHandler
// will be called later when moving the cursor.
-
pTabViewShell->UpdateInputHandler();
}
commit 0c35b728fa3eb46d32bd6bf52307bd58a80ec55e
Author: Pranav Kant <pranavk at collabora.com>
Date: Wed Jun 8 10:27:58 2016 +0530
sc lok: catch unhandled exception
Now, after 432b27ec73940738bb0b4f9d3d749c70a2525700, we do not
export newlines when empty range is selected. Trying to get
transfer data in such a case throws an exception.
(cherry-picked from commit
82ed95b7554cfa3b5e98f67cc53c6219e3a09886)
Change-Id: If2b16bfa2c1932b0599108b989e62e200c1b3b27
(cherry picked from commit 4a2d6bf7ca582a063a209e6dfd59e00f5cb57bfe)
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index e81336a..3c5779c 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -755,7 +755,21 @@ OString ScModelObj::getTextSelection(const char* pMimeType, OString& rUsedMimeTy
if (!xTransferable.is() || !xTransferable->isDataFlavorSupported(aFlavor))
return OString();
- uno::Any aAny(xTransferable->getTransferData(aFlavor));
+ uno::Any aAny;
+ try
+ {
+ aAny = xTransferable->getTransferData(aFlavor);
+ }
+ catch (const datatransfer::UnsupportedFlavorException e)
+ {
+ OSL_TRACE("Caught UnsupportedFlavorException '%s'", OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ return OString();
+ }
+ catch (const css::uno::Exception& e)
+ {
+ OSL_TRACE("Caught UNO Exception '%s'", OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ return OString();
+ }
OString aRet;
if (aFlavor.DataType == cppu::UnoType<OUString>::get())
commit 4afccdf6e66283643864401543848e6dc31408cf
Author: Pranav Kant <pranavk at collabora.com>
Date: Fri Jun 3 00:46:48 2016 +0530
sc: Don't export in case of invalid range
For example, copying an empty column or row range, and then
pasting as unformatted text exports all the newline characters
inspite of the fact that this is an invalid data range.
The problem becomes worse when someone tries to copy an entire
column which implies exporting MAXROW times newline characters.
Change-Id: Ie0a09890e2d0cd5f44d89d520959248e65365ad7
(cherry picked from commit 432b27ec73940738bb0b4f9d3d749c70a2525700)
(cherry picked from commit 14a27ac51d52c7741c8597a2603d2683572e5254)
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 1f84bdc..5988bdb 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1599,7 +1599,8 @@ bool ScImportExport::Doc2Text( SvStream& rStrm )
SCTAB nEndTab = aRange.aEnd.Tab();
if (!pDoc->GetClipParam().isMultiRange() && nStartTab == nEndTab)
- pDoc->ShrinkToDataArea( nStartTab, nStartCol, nStartRow, nEndCol, nEndRow );
+ if (!pDoc->ShrinkToDataArea( nStartTab, nStartCol, nStartRow, nEndCol, nEndRow ))
+ return false;
OUString aCell;
commit b845432185efa77a93b9654c65acf1a1cc5b85f7
Author: Andras Timar <andras.timar at collabora.com>
Date: Mon Jun 13 00:10:20 2016 +0200
Revert "-Werror=missing-field-initializers."
This reverts commit 9afccca15068e3796b30a5910f2abcd9457789ac.
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index f309399..1dad3e0 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -206,7 +206,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
{ OUString("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType<bool>::get(), 0},
{ OUString("PropLineSpacingShrinksFirstLine"), HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE, cppu::UnoType<bool>::get(), 0},
{ OUString("SubtractFlysAnchoredAtFlys"), HANDLE_SUBTRACT_FLYS, cppu::UnoType<bool>::get(), 0},
- { OUString("InBrowseMode"), HANDLE_BROWSE_MODE, cppu::UnoType<bool>::get(), 0, 0},
+ { OUString("InBrowseMode"), HANDLE_BROWSE_MODE, cppu::UnoType<bool>::get(), 0},
/*
* As OS said, we don't have a view when we need to set this, so I have to
* find another solution before adding them to this property set - MTG
More information about the Libreoffice-commits
mailing list