[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-10-12 Thread Eike Rathke
 sc/source/ui/docshell/tablink.cxx |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 8b12ee3ae1f22ada7d8ffb3d86fb7c5b94ef1971
Author: Eike Rathke er...@redhat.com
Date:   Thu Oct 10 18:02:25 2013 +0200

fixed another Out of bounds substring access

Introduced with 3c2a26c84e70fd996855181d319970e2230b2459
Didn't have consequences here because the result was used to check for a
startsWith condition which it wouldn't had matched anyway. However,
use the real startsWith() now.

(cherry picked from commit b1caf176a44b6979d2e0ea47f495a3dacf86e197)

With 5688ab5ba457ea9a50152570d161a11a1d093994 in 4-0 we should have this
as well.

Conflicts:
sc/source/ui/docshell/tablink.cxx

Change-Id: Ia1d558fc106d9a2010ad41c30f7eb2a2a480c59b
Reviewed-on: https://gerrit.libreoffice.org/6223
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/ui/docshell/tablink.cxx 
b/sc/source/ui/docshell/tablink.cxx
index b7d3a54..7a28d22 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -522,12 +522,11 @@ bool ScDocumentLoader::GetFilterName(
 
 void ScDocumentLoader::RemoveAppPrefix( rtl::OUString rFilterName )
 {
-rtl::OUStringBuffer aAppPrefix;
-aAppPrefix.appendAscii(STRING_SCAPP);
-aAppPrefix.appendAscii(: );
-sal_Int32 nPreLen = aAppPrefix.getLength();
-if (rFilterName.copy(0, nPreLen).equals(aAppPrefix.makeStringAndClear()))
-rFilterName = rFilterName.copy(nPreLen);
+rtl::OUStringBuffer aBuf;
+aBuf.appendAscii( STRING_SCAPP).appendAscii( : );
+OUString aAppPrefix( aBuf.makeStringAndClear());
+if (rFilterName.startsWith( aAppPrefix))
+rFilterName = rFilterName.copy( aAppPrefix.getLength());
 }
 
 ScDocumentLoader::ScDocumentLoader( const rtl::OUString rFileName,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-09-16 Thread Julien Nabet
 sc/source/ui/docshell/dbdocfun.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4deb3ec0d5d94a36b3941176b30e662184d2297a
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Sep 15 22:39:23 2013 +0200

fdo#69091: Copying data from Base-table to Calc by drag and drop

Depending on whether the data source is registered, either
rDescriptor[svx::daDataSource]
or
rDescriptor[svx::daDatabaseLocation]
will be filled in (and should be used).

Luckily, ODataAccessDescriptor provides a utility
function that will automatically return the one
that is set. Use that instead of hardcoding svx::daDataSource.

Thank you Lionel!

Change-Id: I02673e7924c4323915dea579015326194c3f5077
Reviewed-on: https://gerrit.libreoffice.org/5960
Tested-by: Lionel Elie Mamane lio...@mamane.lu
Reviewed-by: Lionel Elie Mamane lio...@mamane.lu

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 9f4d58d..79130fd 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1535,7 +1535,7 @@ void ScDBDocFunc::UpdateImport( const String rTarget, 
const svx::ODataAccessDes
 rtl::OUString sDBName;
 rtl::OUString sDBTable;
 sal_Int32 nCommandType = 0;
-rDescriptor[svx::daDataSource]  = sDBName;
+sDBName = rDescriptor.getDataSource();
 rDescriptor[svx::daCommand] = sDBTable;
 rDescriptor[svx::daCommandType] = nCommandType;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-08-19 Thread Noel Power
 sc/source/filter/inc/tablebuffer.hxx |4 +++-
 sc/source/filter/oox/tablebuffer.cxx |   28 +---
 sc/source/filter/oox/worksheethelper.cxx |4 
 3 files changed, 32 insertions(+), 4 deletions(-)

New commits:
commit 0e059b62e4b222b2bb501d0c7798deeb1339d05d
Author: Noel Power noel.po...@suse.com
Date:   Thu Aug 15 16:23:46 2013 +0100

fix for bnc#834705 missing drop downs for autofilter

After commit fc861c7088e9b639a1c2c80f8ba4535c798aeb34 there is now an order
dependency, between any ScPatternAttr flags indirectly set and
SheetDataBuffer::finalizeImport which sets the attributes directly for a 
column
So the ATTR_MERGE_FLAG that has ScMergeFlagAttr ( and associated
 SC_MF_AUTO flag ) is scrubbed when by the direct writting of the attribute
from SheetDataBuffer::finalizeImport - Document::SetAttrEntries
I've reordered that Table import here and split the finalize ( which happens
before heetDataBuffer::finalizeImport ) so that the databaseranges which 
were
created before sheet import still happens, the autofilter part of the import
is now deferred ( until after SheetDataBuffer::finalizeImport )

Change-Id: I11bb45ee7b330760fd93ecca30b23399414ac3a7
Reviewed-on: https://gerrit.libreoffice.org/5448
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sc/source/filter/inc/tablebuffer.hxx 
b/sc/source/filter/inc/tablebuffer.hxx
index 5ed673b..d162391 100644
--- a/sc/source/filter/inc/tablebuffer.hxx
+++ b/sc/source/filter/inc/tablebuffer.hxx
@@ -59,6 +59,7 @@ public:
 
 /** Creates a database range from this tables. */
 voidfinalizeImport();
+voidapplyAutoFilters();
 
 /** Returns the unique table identifier. */
 inline sal_Int32getTableId() const { return maModel.mnId; }
@@ -103,7 +104,8 @@ public:
 
 /** Creates database ranges from all imported tables. */
 voidfinalizeImport();
-
+/** Applies autofilters from created database range ( requires 
finalizeImport to have run before being called */
+voidapplyAutoFilters();
 /** Returns a table by its identifier. */
 TableRefgetTable( sal_Int32 nTableId ) const;
 /** Returns a table by its display name. */
diff --git a/sc/source/filter/oox/tablebuffer.cxx 
b/sc/source/filter/oox/tablebuffer.cxx
index 0748e3c..87e1200 100644
--- a/sc/source/filter/oox/tablebuffer.cxx
+++ b/sc/source/filter/oox/tablebuffer.cxx
@@ -20,6 +20,7 @@
 #include tablebuffer.hxx
 
 #include com/sun/star/sheet/XDatabaseRange.hpp
+#include com/sun/star/sheet/XDatabaseRanges.hpp
 #include oox/helper/attributelist.hxx
 #include oox/helper/binaryinputstream.hxx
 #include oox/helper/propertyset.hxx
@@ -97,9 +98,6 @@ void Table::finalizeImport()
 PropertySet aPropSet( xDatabaseRange );
 if( !aPropSet.getProperty( mnTokenIndex, PROP_TokenIndex ) )
 mnTokenIndex = -1;
-
-// filter settings
-maAutoFilters.finalizeImport( xDatabaseRange );
 }
 catch( Exception )
 {
@@ -107,6 +105,25 @@ void Table::finalizeImport()
 }
 }
 
+void Table::applyAutoFilters()
+{
+if( !maDBRangeName.isEmpty() )
+{
+try
+{
+// get the range ( maybe we should cache the xDatabaseRange from 
finalizeImport )
+PropertySet aDocProps( getDocument() );
+Reference XDatabaseRanges  xDatabaseRanges( 
aDocProps.getAnyProperty( PROP_DatabaseRanges ), UNO_QUERY_THROW );
+Reference XDatabaseRange  xDatabaseRange( 
xDatabaseRanges-getByName( maDBRangeName ), UNO_QUERY );
+maAutoFilters.finalizeImport( xDatabaseRange );
+}
+catch( Exception )
+{
+OSL_FAIL( Table::applyAutofilters - cannot create filter );
+}
+}
+}
+
 // 
 
 TableBuffer::TableBuffer( const WorkbookHelper rHelper ) :
@@ -130,6 +147,11 @@ void TableBuffer::finalizeImport()
 maIdTables.forEachMem( Table::finalizeImport );
 }
 
+void TableBuffer::applyAutoFilters()
+{
+maIdTables.forEachMem( Table::applyAutoFilters );
+}
+
 TableRef TableBuffer::getTable( sal_Int32 nTableId ) const
 {
 return maIdTables.get( nTableId );
diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index f736393..03bde26 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -66,6 +66,7 @@
 #include worksheetbuffer.hxx
 #include worksheetsettings.hxx
 #include formulabuffer.hxx
+#include tablebuffer.hxx
 
 namespace oox {
 namespace xls {
@@ -943,6 +944,9 @@ void WorksheetGlobals::finalizeWorksheetImport()
 {
 lclUpdateProgressBar( mxRowProgress, 1.0 );
 maSheetData.finalizeImport();
+// assumes getTables().finalizeImport ( which creates the 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-08-14 Thread Winfried
 sc/source/filter/oox/formulabase.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 569843373b6654e155f897a2a9e3a02d6e010675
Author: Winfried winfrieddonk...@libreoffice.org
Date:   Thu Aug 8 11:26:04 2013 +0200

fdo#59727 fix #NAME?-error with add-in functions on (re)open of xlsx

Change-Id: Ia3c452f21328e2d5773f245e729905a70d14c29e
Reviewed-on: https://gerrit.libreoffice.org/5312
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com
(cherry picked from commit 27aeea8e2bd374ec2f7317ac485315118ea1feee)

Signed-off-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/filter/oox/formulabase.cxx 
b/sc/source/filter/oox/formulabase.cxx
index ec3c411..9879c46 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -793,6 +793,18 @@ static const FunctionData saFuncTableOdf[] =
 { XOR,0,  NOID,   NOID,   1,  
MX, V, { RX }, FUNCFLAG_MACROCALLODF }
 };
 
+/** Functions defined by calc, but not in OpenFormula nor supported by Excel. 
*/
+static const FunctionData saFuncTableOOoLO[] =
+{
+{ ORG.OPENOFFICE.WEEKS,   ORG.OPENOFFICE.WEEKS,   NOID,   
NOID,   3,  3,  V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL },
+{ ORG.OPENOFFICE.MONTHS,  ORG.OPENOFFICE.MONTHS,  NOID,   
NOID,   3,  3,  V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL },
+{ ORG.OPENOFFICE.YEARS,   ORG.OPENOFFICE.YEARS,   NOID,   
NOID,   3,  3,  V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL },
+{ ORG.OPENOFFICE.ISLEAPYEAR,  ORG.OPENOFFICE.ISLEAPYEAR,  NOID,   
NOID,   1,  1,  V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL },
+{ ORG.OPENOFFICE.DAYSINMONTH, ORG.OPENOFFICE.DAYSINMONTH, NOID,   
NOID,   1,  1,  V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL },
+{ ORG.OPENOFFICE.DAYSINYEAR,  ORG.OPENOFFICE.DAYSINYEAR,  NOID,   
NOID,   1,  1,  V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL },
+{ ORG.OPENOFFICE.WEEKSINYEAR, ORG.OPENOFFICE.WEEKSINYEAR, NOID,   
NOID,   1,  1,  V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL },
+{ ORG.OPENOFFICE.ROT13,   ORG.OPENOFFICE.ROT13,   NOID,   
NOID,   1,  1,  V, { VR }, FUNCFLAG_MACROCALL_NEW | FUNCFLAG_EXTERNAL }
+};
 // 
 
 const sal_Unicode API_TOKEN_OPEN= '(';
@@ -913,6 +925,7 @@ FunctionProviderImpl::FunctionProviderImpl( FilterType 
eFilter, BiffType eBiff,
 initFuncs( saFuncTableOox, STATIC_ARRAY_END( saFuncTableOox ), nMaxParam, 
bImportFilter, eFilter );
 initFuncs( saFuncTable2013, STATIC_ARRAY_END( saFuncTable2013 ), 
nMaxParam, bImportFilter, eFilter );
 initFuncs( saFuncTableOdf, STATIC_ARRAY_END( saFuncTableOdf ), nMaxParam, 
bImportFilter, eFilter );
+initFuncs( saFuncTableOOoLO, STATIC_ARRAY_END( saFuncTableOOoLO ), 
nMaxParam, bImportFilter, eFilter );
 }
 
 void FunctionProviderImpl::initFunc( const FunctionData rFuncData, sal_uInt8 
nMaxParam )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-08-03 Thread Eike Rathke
 sc/source/filter/excel/excrecds.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1427632d172f26fb0b15f2d162da2fca8e701f9f
Author: Eike Rathke er...@redhat.com
Date:   Sat Aug 3 12:53:49 2013 +0200

hopefully fixed MSVC build breaker, ambiguous call to overloaded function

Change-Id: I923846f8ea8d61547aab2aaeab2232439b5e4a72

diff --git a/sc/source/filter/excel/excrecds.cxx 
b/sc/source/filter/excel/excrecds.cxx
index 035e4d1..fc114ec 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -515,7 +515,7 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream rStrm 
)
 {
 nHash = ((aHash[0]  8)  0x);
 nHash |= (aHash[1]  0xFF);
-sHash = OString::valueOf( nHash, 16 );
+sHash = OString::valueOf( static_castsal_Int32(nHash), 16 );
 }
 sax_fastparser::FSHelperPtr rWorksheet = rStrm.GetCurrentStream();
 rWorksheet-singleElement( XML_sheetProtection,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-07-28 Thread Kohei Yoshida
 sc/source/core/tool/interpr1.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c8fb4f13309ffecbaa72e0108315bb917ea33064
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Sat Jul 27 16:33:00 2013 -0400

fdo#61201: Don't forget to calculate row offset for external single ref.

Change-Id: Ie3dbf2eeba98a60aa2426b1db35ac885102d3821
(cherry picked from commit 8b96cfd6caedbad7b3b79e57421a834f18c5c511)
Reviewed-on: https://gerrit.libreoffice.org/5143
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 5ee90fa..c4d8389 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -7958,6 +7958,7 @@ void ScInterpreter::ScOffset()
 nCol1 = (SCCOL)((long)nCol1+nColPlus);
 nRow1 = (SCROW)((long)nRow1+nRowPlus);
 nCol2 = (SCCOL)((long)nCol1+nColNew-1);
+nRow2 = (SCROW)((long)nRow1+nRowNew-1);
 nTab2 = nTab1;
 if (!ValidCol(nCol1) || !ValidRow(nRow1) ||
 !ValidCol(nCol2) || !ValidRow(nRow2))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-06-26 Thread Winfried Donkers
 sc/source/ui/view/cellsh1.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e51def95b7b2d7627d97ca898846f3d3be791b3d
Author: Winfried Donkers o...@dci-electronics.nl
Date:   Wed Jun 26 08:00:17 2013 +0200

fdo#65856 allow shift cells in paste special for copy-mode

Change-Id: I7a7e13104e7256da9a82e16e14ddfa04e35e7f8a
Reviewed-on: https://gerrit.libreoffice.org/4525
Tested-by: Eike Rathke er...@redhat.com
Reviewed-by: Eike Rathke er...@redhat.com
(cherry picked from commit e513fffeac1f4a814f644f156d88fc8810af4e46)

Signed-off-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index e51a33a..f1bc413 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1294,7 +1294,7 @@ void ScCellShell::ExecuteEdit( SfxRequest rReq )
  nClipStartX + nClipSizeX, 
nClipStartY + nClipSizeY, nStartTab );
 ScRange aDest( nStartX, nStartY, nStartTab,
nStartX + nRangeSizeX, 
nStartY + nRangeSizeY, nStartTab );
-if ( aSource.Intersects( aDest ) )
+if ( pOwnClip-GetDocument()-IsCutMode() 
 aSource.Intersects( aDest ) )
 pDlg-SetCellShiftDisabled( 
SC_CELL_SHIFT_DISABLE_DOWN | SC_CELL_SHIFT_DISABLE_RIGHT );
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-06-18 Thread Eike Rathke
 sc/source/core/tool/interpr2.cxx |   59 ++-
 1 file changed, 46 insertions(+), 13 deletions(-)

New commits:
commit fa270848936d2ca9ddd312fc551ab189896b9417
Author: Eike Rathke er...@redhat.com
Date:   Mon Jun 17 21:17:40 2013 +0200

resolved fdo#65082 RATE function should not find roots = -1

Limit RATE to roots  -1.0, which is what also Excel and now Gnumeric
do. If the Newton goal seek fails for the default guess value 0.1 try
other values.

This now also calculates the few remaining error cases of i#15090
attachment https://issues.apache.org/ooo/attachment.cgi?id=6528
correctly.

Change-Id: Ic62cc807626b4715035c3076f58f303b9020db5a
(cherry picked from commit 9ee7be4efb494351c4be096ffa04cdbd85cdc3d4)
Reviewed-on: https://gerrit.libreoffice.org/4327
Reviewed-by: Noel Power noel.po...@suse.com
Tested-by: Noel Power noel.po...@suse.com

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index a25826c..713966f 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1419,16 +1419,19 @@ bool ScInterpreter::RateIteration( double fNper, double 
fPayment, double fPv,
 fXnew = fX + 1.1 * SCdEpsilon;  // move away from zero 
slope
 else
 fXnew = fX - fTerm / fTermDerivation;
-nCount++;
-// more accuracy not possible in oscillating cases
-bFound = (fabs(fXnew - fX)  SCdEpsilon);
-fX = fXnew;
+nCount++;
+// more accuracy not possible in oscillating cases
+bFound = (fabs(fXnew - fX)  SCdEpsilon);
+fX = fXnew;
 }
 }
 // Gnumeric returns roots  -1, Excel gives an error in that cases,
 // ODFF says nothing about it. Enable the statement, if you want 
Excel's
-// behavior
+// behavior.
 //bValid =(fX =-1.0);
+// Update 2013-06-17: Gnumeric (v1.12.2) doesn't return roots = -1
+// anymore.
+bValid = (fX  -1.0);
 }
 else
 { // Nper is not an integer value.
@@ -1455,11 +1458,11 @@ bool ScInterpreter::RateIteration( double fNper, double 
fPayment, double fPv,
 fXnew = fX + 1.1 * SCdEpsilon;  // move away from zero 
slope
 else
 fXnew = fX - fTerm / fTermDerivation;
-nCount++;
- // more accuracy not possible in oscillating cases
-bFound = (fabs(fXnew - fX)  SCdEpsilon);
-fX = fXnew;
-bValid = (fX = -1.0);  // otherwise pow(1.0+fX,fNper) will fail
+nCount++;
+// more accuracy not possible in oscillating cases
+bFound = (fabs(fXnew - fX)  SCdEpsilon);
+fX = fXnew;
+bValid = (fX = -1.0);  // otherwise pow(1.0+fX,fNper) will 
fail
 }
 }
 }
@@ -1473,14 +1476,18 @@ void ScInterpreter::ScZins()
 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, sc, er, ScInterpreter::ScZins );
 double fPv, fPayment, fNper;
 // defaults for missing arguments, see ODFF spec
-double fFv = 0, fPayType = 0, fGuess = 0.1;
+double fFv = 0, fPayType = 0, fGuess = 0.1, fOrigGuess = 0.1;
 bool bValid = true;
+bool bDefaultGuess = true;
 nFuncFmtType = NUMBERFORMAT_PERCENT;
 sal_uInt8 nParamCount = GetByte();
 if ( !MustHaveParamCount( nParamCount, 3, 6 ) )
 return;
 if (nParamCount == 6)
-fGuess = GetDouble();
+{
+fOrigGuess = fGuess = GetDouble();
+bDefaultGuess = false;
+}
 if (nParamCount = 5)
 fPayType = GetDouble();
 if (nParamCount = 4)
@@ -1498,7 +1505,33 @@ void ScInterpreter::ScZins()
 //if (fPayType != 0.0) fPayType = 1.0;
 bValid = RateIteration(fNper, fPayment, fPv, fFv, fPayType, fGuess);
 if (!bValid)
-SetError(errNoConvergence);
+{
+/* TODO: try also for specified guess values, not only default? As is,
+ * a specified 0.1 guess may be error result but a default 0.1 guess
+ * may succeed. On the other hand, using a different guess value than
+ * the specified one may not be desired, even if that didn't match. */
+if (bDefaultGuess)
+{
+/* TODO: this is rather ugly, instead of looping over different
+ * guess values and doing a Newton goal seek for each we could
+ * first insert the values into the RATE equation to obtain a set
+ * of y values and then do a bisecting goal seek, possibly using
+ * different algorithms. */
+double fX = fOrigGuess;
+for (int nStep = 2; nStep = 10  !bValid; ++nStep)
+{
+fGuess = fX * nStep;
+bValid = RateIteration( fNper, fPayment, fPv, fFv, fPayType, 
fGuess);
+if (!bValid)
+ 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-06-07 Thread Markus Mohrhard
 sc/source/ui/view/viewfun2.cxx |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 728d6cea85e68a563822b6017707a98085a7058c
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Jun 7 06:41:14 2013 +0200

only reset marked area when using find/replace all, fdo#53106

Change-Id: I151db5db7bcdf5295e1f67423de8926250ae8ea3
Reviewed-on: https://gerrit.libreoffice.org/4185
Reviewed-by: Kohei Yoshida kohei.yosh...@suse.de
Tested-by: Kohei Yoshida kohei.yosh...@suse.de

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 590e134..2a02c94 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1647,12 +1647,15 @@ void ScViewFunc::SearchAndReplace( const SvxSearchItem* 
pSearchItem,
 aUndoStr, pUndoDoc.release(), 
pSearchItem ) );
 }
 
-rMark.ResetMark();
-for (size_t i = 0, n = aMatchedRanges.size(); i  n; ++i)
+if (nCommand == SVX_SEARCHCMD_FIND_ALL || nCommand == 
SVX_SEARCHCMD_REPLACE_ALL)
 {
-const ScRange r = *aMatchedRanges[i];
-if (r.aStart.Tab() == nTab)
-rMark.SetMultiMarkArea(r);
+rMark.ResetMark();
+for (size_t i = 0, n = aMatchedRanges.size(); i  n; ++i)
+{
+const ScRange r = *aMatchedRanges[i];
+if (r.aStart.Tab() == nTab)
+rMark.SetMultiMarkArea(r);
+}
 }
 
 break;  // break 'while (TRUE)'
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-06-06 Thread Markus Mohrhard
 sc/source/filter/xml/xmlrowi.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 2e5b6fd2d1c1b23eef3c3bfb0efd7a27d21d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Jun 3 04:49:12 2013 +0200

correct fix for fdo#62938

Change-Id: I8569e4e120a6fd2b626db0bdaadf5d9234d09a36
Reviewed-on: https://gerrit.libreoffice.org/4138
Reviewed-by: Kohei Yoshida kohei.yosh...@suse.de
Tested-by: Kohei Yoshida kohei.yosh...@suse.de

diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx
index ec4c5a5..e250d6c 100644
--- a/sc/source/filter/xml/xmlrowi.cxx
+++ b/sc/source/filter/xml/xmlrowi.cxx
@@ -231,7 +231,8 @@ ScXMLTableRowsContext::ScXMLTableRowsContext( ScXMLImport 
rImport,
 // don't have any attributes
 if (bHeader)
 {
-nHeaderStartRow = rImport.GetTables().GetCurrentRow();
+ScAddress aAddr = rImport.GetTables().GetCurrentCellPos();
+nHeaderStartRow = aAddr.Row();
 ++nHeaderStartRow;
 }
 else if (bGroup)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-06-06 Thread Markus Mohrhard
 sc/source/ui/view/output2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6fadc3a2d8d95088bc07f9064bf262f8c7d30577
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Jun 7 05:28:04 2013 +0200

don't hide cell content behind pivot table buttons, fdo#60877

Change-Id: I1508aafcc7046c576a4d6de87900dc66f32b2f97
Reviewed-on: https://gerrit.libreoffice.org/4184
Reviewed-by: Kohei Yoshida kohei.yosh...@suse.de
Tested-by: Kohei Yoshida kohei.yosh...@suse.de

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 5461fec..6fa83c3 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1353,7 +1353,7 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, 
long nPosX, long nPosY
 // (for automatic line break: only if not formatting for printer, as 
in ScColumn::GetNeededSize)
 
 if ( eType==OUTTYPE_WINDOW 
- ( static_castconst 
ScMergeFlagAttr(rPattern.GetItem(ATTR_MERGE_FLAG)).GetValue()  SC_MF_AUTO ) 

+ ( static_castconst 
ScMergeFlagAttr(rPattern.GetItem(ATTR_MERGE_FLAG)).GetValue()  
(SC_MF_AUTO|SC_MF_BUTTON|SC_MF_BUTTON_POPUP) ) 
  ( !bBreak || mpRefDevice == pFmtDevice ) )
 {
 // filter drop-down width is now independent from row height
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-28 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 276508a97d9d5a03169d3d8906e5a6d3ff3d0b0b
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue May 28 02:15:52 2013 +0200

correctly delete note captions, fdo#64068

This fixes fdo#64068 and correctly without reintroducing the crash with
Undo/Redo.

Change-Id: I9ad48f6dbb7f1587985f8da9eba3886dfd4068de
Reviewed-on: https://gerrit.libreoffice.org/4066
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 47cd340..00d0632 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -565,7 +565,9 @@ void ScTable::DeleteSelection( sal_uInt16 nDelFlag, const 
ScMarkData rMark )
 {
 ScRange* pRange = aRangeList[i];
 if (nDelFlag  IDF_NOTE  pRange)
-maNotes.erase(pRange-aStart.Col(), pRange-aStart.Row(), 
pRange-aEnd.Col(), pRange-aEnd.Row(), true);
+{
+maNotes.erase(pRange-aStart.Col(), pRange-aStart.Row(), 
pRange-aEnd.Col(), pRange-aEnd.Row(), nDelFlag  IDF_NOCAPTIONS);
+}
 
 if((nDelFlag  IDF_ATTRIB)  pRange  pRange-aStart.Tab() == nTab)
 mpCondFormatList-DeleteArea( pRange-aStart.Col(), 
pRange-aStart.Row(), pRange-aEnd.Col(), pRange-aEnd.Row() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-28 Thread Markus Mohrhard
 sc/source/core/tool/interpr1.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c05cfe8396ba3581432290e018265c92c4701ded
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon May 27 21:58:04 2013 +0200

restore old behavior for external references, fdo#64229

Change-Id: Iae160607447ff6e1133f9e1e6f9c6a9f1e7bd7ab
Reviewed-on: https://gerrit.libreoffice.org/4062
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 994bc2b..5ee90fa 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -5490,7 +5490,7 @@ double ScInterpreter::IterateParametersIf( ScIterFuncIf 
eFunc )
 case svExternalSingleRef:
 case svExternalDoubleRef:
 {
-pQueryMatrix = PopMatrix();
+pQueryMatrix = GetMatrix();
 if (!pQueryMatrix)
 {
 SetError( errIllegalParameter);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-28 Thread Faisal M . Al-Otaibi
 sc/source/ui/view/gridwin5.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit d158bdce41ce0a199ef0e862f667399b571704b6
Author: Faisal M. Al-Otaibi fmalota...@kacst.edu.sa
Date:   Tue May 28 11:22:33 2013 +0200

fdo#63323 fix the comment position when the mouse over cell

fix the X position when the sheet are RTL.

Change-Id: I9b38a840fb17a70e1ba60d46b8c83b7e498501e1
Reviewed-on: https://gerrit.libreoffice.org/4069
Reviewed-by: Jan Holesovsky ke...@suse.cz
Tested-by: Jan Holesovsky ke...@suse.cz
(cherry picked from commit 3f923bf9cf9b6fe728e7804fdb13aabe620d3dbc)

diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 9789a24..c1fb32a 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -222,6 +222,10 @@ bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW 
nPosY, bool bKeyboard )
 MapMode aDrawMode = GetDrawMapMode();
 Point aCurPosHmm = PixelToLogic(aScreenPos, aDrawMode );
 Point aGridOff = aCurPosHmm -aOldPos;
+// fdo#63323 fix the X Position for the showing comment 
when
+// the mouse over the cell when the sheet are RTL
+if ( pDoc-IsNegativePage(nTab))
+aGridOff.setX(aCurPosHmm.getX() + aOldPos.getX());
 pNoteMarker-SetGridOff( aGridOff );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-27 Thread Markus Mohrhard
 sc/source/ui/docshell/arealink.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit a8fb2124310e9f21ca75f2a39b95cdf021173e36
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon May 27 13:36:16 2013 +0200

range names need to be checked upper case, fdo#64031

Change-Id: I540821fd7058bf0da27d955c9d966a10dd21ec94
Reviewed-on: https://gerrit.libreoffice.org/4050
Reviewed-by: Noel Power noel.po...@suse.com
Tested-by: Noel Power noel.po...@suse.com

diff --git a/sc/source/ui/docshell/arealink.cxx 
b/sc/source/ui/docshell/arealink.cxx
index 84d30be..ee322d5 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -193,10 +193,11 @@ bool ScAreaLink::IsEqual( const String rFile, const 
String rFilter, const Stri
 bool ScAreaLink::FindExtRange( ScRange rRange, ScDocument* pSrcDoc, const 
String rAreaName )
 {
 bool bFound = false;
+rtl::OUString aUpperName = ScGlobal::pCharClass-uppercase(rAreaName);
 ScRangeName* pNames = pSrcDoc-GetRangeName();
 if (pNames) // benannte Bereiche
 {
-const ScRangeData* p = pNames-findByUpperName(rAreaName);
+const ScRangeData* p = pNames-findByUpperName(aUpperName);
 if (p  p-IsValidReference(rRange))
 bFound = true;
 }
@@ -205,7 +206,7 @@ bool ScAreaLink::FindExtRange( ScRange rRange, ScDocument* 
pSrcDoc, const Strin
 ScDBCollection* pDBColl = pSrcDoc-GetDBCollection();
 if (pDBColl)
 {
-const ScDBData* pDB = 
pDBColl-getNamedDBs().findByUpperName(ScGlobal::pCharClass-uppercase(rAreaName));
+const ScDBData* pDB = 
pDBColl-getNamedDBs().findByUpperName(aUpperName);
 if (pDB)
 {
 SCTAB nTab;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-27 Thread Markus Mohrhard
 sc/source/filter/dif/difimp.cxx |   36 +++-
 sc/source/filter/inc/dif.hxx|2 +-
 2 files changed, 12 insertions(+), 26 deletions(-)

New commits:
commit bf88119dca0a7c1b1e5e1082c8deada4cdac37c2
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon May 27 14:59:42 2013 +0200

we need a reference to the DifParser.aData, fdo#64920

regression from 6191fa0847ac5b27083efe1a8c6cd84d080a638c

Change-Id: If7fc18e7d0bcbf1075a0ecdb1c0dcf3d207f1bda
Reviewed-on: https://gerrit.libreoffice.org/4054
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index 4487915..dfc68a3 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -61,7 +61,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream 
rIn, ScDocument* pDoc,
 sal_BoolbSyntErrWarn = false;
 sal_BoolbOverflowWarn = false;
 
-rtl::OUString   aData = aDifParser.aData;
+rtl::OUString   aData = aDifParser.aData;
 sal_BoolbData = false;
 
 rIn.Seek( 0 );
@@ -372,7 +372,7 @@ TOPIC DifParser::GetNextTopic( void )
 if( aLine.getLength()  2 )
 aData = aLine.copy( 1, aLine.getLength() - 2 );
 else
-aData.Erase();
+aData = OUString();
 eS = S_END;
 break;
 case S_END:
@@ -395,20 +395,14 @@ TOPIC DifParser::GetNextTopic( void )
 }
 
 
-static void lcl_DeEscapeQuotesDif( String rString )
+static void lcl_DeEscapeQuotesDif( OUString rString )
 {
 //  Special handling for DIF import: Escaped (duplicated) quotes are 
resolved.
 //  Single quote characters are left in place because older versions didn't
 //  escape quotes in strings (and Excel doesn't when using the clipboard).
 //  The quotes around the string are removed before this function is 
called.
 
-static const sal_Unicode aDQ[] = { '', '', 0 };
-xub_StrLen nPos = 0;
-while ( (nPos = rString.Search( aDQ, nPos )) != STRING_NOTFOUND )
-{
-rString.Erase( nPos, 1 );
-++nPos;
-}
+rString = rString.replaceAll(\\, \);
 }
 
 // Determine if passed in string is numeric data and set fVal/nNumFormat if so
@@ -528,18 +522,14 @@ DATASET DifParser::GetNextDataset( void )
 ReadNextLine( aTmpLine );
 if ( eRet == D_SYNT_ERROR )
 {   // for broken records write #ERR: data to cell
-String aTmp( RTL_CONSTASCII_USTRINGPARAM( #ERR:  ));
-aTmp += pAktBuffer;
-aTmp.AppendAscii(  ( );
-OSL_ENSURE( aTmpLine.getLength() = STRING_MAXLEN - 
aTmp.Len() - 1, GetNextDataset(): line doesn't fit into data);
-aTmp += aTmpLine;
-aTmp += sal_Unicode(')');
-aData = aTmp;
+OUStringBuffer aTmp(#ERR: );
+aTmp.append(pAktBuffer).append( ();
+aTmp.append(aTmpLine).append(')');
+aData = aTmp.makeStringAndClear();
 eRet = D_STRING;
 }
 else
 {
-OSL_ENSURE( aTmpLine.getLength() = STRING_MAXLEN, 
GetNextDataset(): line doesn't fit into data);
 aData = aTmpLine;
 }
 }
@@ -561,7 +551,6 @@ DATASET DifParser::GetNextDataset( void )
 // Single line string
 if( nLineLength = 2  pLine[nLineLength - 1] == '' )
 {
-OSL_ENSURE( aLine.getLength() - 2 = 
STRING_MAXLEN, GetNextDataset(): line doesn't fit into data);
 aData = aLine.copy( 1, nLineLength - 2 );
 lcl_DeEscapeQuotesDif( aData );
 eRet = D_STRING;
@@ -570,12 +559,11 @@ DATASET DifParser::GetNextDataset( void )
 else
 {
 // Multiline string
-OSL_ENSURE( aLine.getLength() - 1 = STRING_MAXLEN, 
GetNextDataset(): line doesn't fit into data);
 aData = aLine.copy( 1 );
 bool bContinue = true;
 while ( bContinue )
 {
-aData.Append( '\n' );
+aData = aData + \n;
 bContinue = !rIn.IsEof()  ReadNextLine( aLine );
 if( bContinue )
 {
@@ -586,13 +574,11 @@ DATASET DifParser::GetNextDataset( void )
 bContinue = !LookAhead();
 if( bContinue )
 {
-  

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-17 Thread Manal Alhassoun
 sc/source/ui/undo/undotab.cxx  |1 +
 sc/source/ui/view/viewfun2.cxx |1 +
 2 files changed, 2 insertions(+)

New commits:
commit 6e6b9e4511baf189ce4e65c787765fd685ba2288
Author: Manal Alhassoun malhass...@kacst.edu.sa
Date:   Wed May 15 12:59:23 2013 +0300

fix for fdo#53031

Change-Id: I137f2446d08b7b536ded26676132e63489e26e48
Reviewed-on: https://gerrit.libreoffice.org/3914
Reviewed-by: Bosdonnat Cedric cedric.bosdon...@free.fr
Tested-by: Bosdonnat Cedric cedric.bosdon...@free.fr
(cherry picked from commit 08662568a590bfb20849fce077d8b5aff8b99b57)

diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 9732e21..54ea512 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -356,6 +356,7 @@ void ScUndoDeleteTab::Undo()
 pDoc-SetVisible( nTab, pRefUndoDoc-IsVisible( nTab ) );
 pDoc-SetTabBgColor( nTab, pRefUndoDoc-GetTabBgColor(nTab) );
 pDoc-SetSheetEvents( nTab, pRefUndoDoc-GetSheetEvents( nTab ) );
+pDoc-SetLayoutRTL( nTab, pRefUndoDoc-IsLayoutRTL( nTab ) );
 
 if ( pRefUndoDoc-IsTabProtected( nTab ) )
 pDoc-SetTabProtection(nTab, 
pRefUndoDoc-GetTabProtection(nTab));
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 2dd4871..590e134 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2144,6 +2144,7 @@ sal_Bool ScViewFunc::DeleteTables(const vectorSCTAB 
TheTabs, sal_Bool bRecord
 pUndoDoc-SetVisible( nTab, pDoc-IsVisible( nTab ) );
 pUndoDoc-SetTabBgColor( nTab, pDoc-GetTabBgColor(nTab) );
 pUndoDoc-SetSheetEvents( nTab, pDoc-GetSheetEvents( nTab ) );
+pUndoDoc-SetLayoutRTL( nTab, pDoc-IsLayoutRTL( nTab ) );
 
 if ( pDoc-IsTabProtected( nTab ) )
 pUndoDoc-SetTabProtection(nTab, pDoc-GetTabProtection(nTab));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-17 Thread Noel Power
 sc/source/ui/view/drawview.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 1e489d411a40c6b98966917c3849c8bcc110de34
Author: Noel Power noel.po...@suse.com
Date:   Fri May 17 11:05:02 2013 +0100

Revert fdo#63878 fix the zoom problem when the sheet are RTL

This reverts commit 9411d4d56374a55777019d58c1e7f45767662707.

Change-Id: I1165ab1a2c0059e40c4963c99cabfcadb7d0bcb4
Reviewed-on: https://gerrit.libreoffice.org/3932
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 7e4555d..6900932 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -791,9 +791,6 @@ void ScDrawView::SyncForGrid( SdrObject* pObj )
 Point aCurPos =  pViewData-GetScrPos(  aOldStt.Col(), aOldStt.Row(), 
eWhich, sal_True );
 Point aCurPosHmm = pGridWin-PixelToLogic(aCurPos, aDrawMode );
 Point aGridOff = ( aCurPosHmm - aOldPos );
-// fdo#63878 Fix the X position for RTL Sheet
-if( aGridOff.getX()  0 )
-aGridOff.setX( aCurPosHmm.getX() + aOldPos.getX() );
 pObj-SetGridOffset( aGridOff );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source tools/inc tools/source

2013-05-17 Thread Eike Rathke
 sc/source/core/data/table4.cxx  |3 +--
 tools/inc/tools/date.hxx|7 +++
 tools/source/datetime/tdate.cxx |   29 -
 3 files changed, 28 insertions(+), 11 deletions(-)

New commits:
commit 0b183466bcdf56c9221ab28be9c52ed8787fe4ea
Author: Eike Rathke er...@redhat.com
Date:   Fri May 17 14:04:34 2013 +0200

resolved fdo#63805 max day of month of the intended month

Since 6619955e72c1c2f29a32e82478d19147c0d7610a Date::GetDaysInMonth()
operates on the normalized value that corresponds to the actual values
set at the Date instance, obtain and set number of days for the intended
month instead of using the rolled-over date.

(cherry picked from commit cd9d1bdf5e3351c929d5b651c009ee17b4d962c4)

Conflicts:
sc/source/core/data/table4.cxx

Change-Id: Ia6b007675104f8e134b278f216c3bb48b72f061c
Reviewed-on: https://gerrit.libreoffice.org/3938
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 4aec7df..57c9eda 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1253,8 +1253,7 @@ void ScTable::IncDate(double rVal, sal_uInt16 
nDayOfMonth, double nStep, FillD
 {
 aDate.SetMonth((sal_uInt16) nMonth);
 aDate.SetYear((sal_uInt16) nYear);
-if ( nDayOfMonth  28 )
-aDate.SetDay( Min( aDate.GetDaysInMonth(), nDayOfMonth 
) );
+aDate.SetDay( std::min( Date::GetDaysInMonth( nMonth, 
nYear), nDayOfMonth ) );
 }
 }
 break;
diff --git a/tools/inc/tools/date.hxx b/tools/inc/tools/date.hxx
index 42c7c16..cf72a6c 100644
--- a/tools/inc/tools/date.hxx
+++ b/tools/inc/tools/date.hxx
@@ -140,6 +140,13 @@ public:
 TOOLS_DLLPUBLIC friend Date operator -( const Date rDate, long nDays 
);
 TOOLS_DLLPUBLIC friend long operator -( const Date rDate1, const 
Date rDate2 );
 
+/** Obtain number of days in a month of a year.
+
+Internally sanitizes nMonth to values 1 = nMonth = 12, does not
+normalize values.
+ */
+static sal_uInt16 GetDaysInMonth( sal_uInt16 nMonth, sal_uInt16 nYear );
+
 /// Internally normalizes values.
 static long DateToDays( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 
nYear );
 /// Semantically identical to IsValidDate() member method.
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index d1a6c94..5ead33f 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -44,7 +44,7 @@ inline sal_Bool ImpIsLeapYear( sal_uInt16 nYear )
 }
 
 // All callers must have sanitized or normalized month and year values!
-inline sal_uInt16 DaysInMonth( sal_uInt16 nMonth, sal_uInt16 nYear )
+inline sal_uInt16 ImplDaysInMonth( sal_uInt16 nMonth, sal_uInt16 nYear )
 {
 if ( nMonth != 2 )
 return aDaysInMonth[nMonth-1];
@@ -57,6 +57,17 @@ inline sal_uInt16 DaysInMonth( sal_uInt16 nMonth, sal_uInt16 
nYear )
 }
 }
 
+// static
+sal_uInt16 Date::GetDaysInMonth( sal_uInt16 nMonth, sal_uInt16 nYear )
+{
+SAL_WARN_IF( nMonth  1 || 12  nMonth, tools, Date::GetDaysInMonth - 
nMonth out of bounds   nMonth);
+if (nMonth  1)
+nMonth = 1;
+else if (12  nMonth)
+nMonth = 12;
+return ImplDaysInMonth( nMonth, nYear);
+}
+
 long Date::DateToDays( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 nYear )
 {
 long nDays;
@@ -66,7 +77,7 @@ long Date::DateToDays( sal_uInt16 nDay, sal_uInt16 nMonth, 
sal_uInt16 nYear )
 nDays = ((sal_uIntPtr)nYear-1) * 365;
 nDays += ((nYear-1) / 4) - ((nYear-1) / 100) + ((nYear-1) / 400);
 for( sal_uInt16 i = 1; i  nMonth; i++ )
-nDays += DaysInMonth(i,nYear);
+nDays += ImplDaysInMonth(i,nYear);
 nDays += nDay;
 return nDays;
 }
@@ -105,9 +116,9 @@ static void DaysToDate( long nDays,
 while ( bCalc );
 
 rMonth = 1;
-while ( (sal_uIntPtr)nTempDays  DaysInMonth( rMonth, rYear ) )
+while ( (sal_uIntPtr)nTempDays  ImplDaysInMonth( rMonth, rYear ) )
 {
-nTempDays -= DaysInMonth( rMonth, rYear );
+nTempDays -= ImplDaysInMonth( rMonth, rYear );
 rMonth++;
 }
 rDay = (sal_uInt16)nTempDays;
@@ -179,7 +190,7 @@ sal_uInt16 Date::GetDayOfYear() const
 Normalize( nDay, nMonth, nYear);
 
 for( sal_uInt16 i = 1; i  nMonth; i++ )
- nDay = nDay + ::DaysInMonth( i, nYear );   // += yields a warning on 
MSVC, so don't use it
+ nDay = nDay + ::ImplDaysInMonth( i, nYear );   // += yields a warning 
on MSVC, so don't use it
 return nDay;
 }
 
@@ -279,7 +290,7 @@ sal_uInt16 Date::GetDaysInMonth() const
 sal_uInt16 nYear  = GetYear();
 Normalize( nDay, nMonth, nYear);
 
-return DaysInMonth( nMonth, nYear );
+

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-15 Thread Eike Rathke
 sc/source/ui/docshell/impex.cxx |   13 -
 1 file changed, 13 deletions(-)

New commits:
commit 09ff02c499579c1dd9eed500121875e586ea8716
Author: Eike Rathke er...@redhat.com
Date:   Tue May 14 13:39:27 2013 +0200

resolved fdo#60468 no special tab case workaround for CSV import

This reverts 322cbc3818b0553254aab2dfb3c5b196fe814097 Import mal-formed
csv files gracefully. (code now moved to a different location) which
was a workaround for a specific situation that breaks things with other
documents.

With the rework of CSV import for 3.6 the import of the one failing
document https://bugzilla.novell.com/attachment.cgi?id=294589 from
https://bugzilla.novell.com/show_bug.cgi?id=507322 works almost fine
without this workaround, with one difference in row 1805 where data is
completely broken and parts of two rows end up in one cell P1805. That
row wasn't correct with the workaround either, see also cell P1805 in
earlier versions.

As a result now without that workaround there is one data row less for
the broken document but correct data for correct documents.

Change-Id: Iacf56993619cd92c1df81f0c49de0eeb04c2e4e4
(cherry picked from commit a883783c2a1b0e7a8ee5b46387d1e1e3bc5e19bd)
Reviewed-on: https://gerrit.libreoffice.org/3905
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 9734f72..eab9baf 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2304,9 +2304,6 @@ rtl::OUString ReadCsvLine( SvStream rStream, bool 
bEmbeddedLineBreak,
 {
 const sal_Unicode* pSeps = rFieldSeparators.GetBuffer();
 
-// See if the separator(s) include tab.
-bool bTabSep = lcl_UnicodeStrChr(pSeps, '\t') != NULL;
-
 QuoteType eQuoteState = FIELDEND_QUOTE;
 bool bFieldStart = true;
 
@@ -2321,16 +2318,6 @@ rtl::OUString ReadCsvLine( SvStream rStream, bool 
bEmbeddedLineBreak,
 {
 if (nQuotes)
 {
-if (bTabSep  *p == '\t'  (nQuotes % 2) != 0)
-{
-// When tab-delimited, tab char ends quoted sequence
-// even if we haven't reached the end quote.  Doing
-// this helps keep mal-formed rows from damaging
-// other, well-formed rows.
-nQuotes = 0;
-break;
-}
-
 if (*p == cFieldQuote)
 {
 if (bFieldStart)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-13 Thread Noel Power
 sc/source/filter/excel/xlstyle.cxx |   20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 08cfff8437bf8ec13bd9c1ccfa99ad2a7bde6756
Author: Noel Power noel.po...@suse.com
Date:   Tue May 7 16:41:27 2013 +0100

fix for fdo#51300

Hopefully a better choice for defaults will minimise the chance of a bad 
colour
combination for notetext and notebackground colours when one colour ( more 
than
likely the notetext colour ) is gleaned from some default ( e.g. like a 
system
 tooltip colour ). We change the choice from system helptext ( fg  bg ) 
colours
and use Libreoffice default font and default note background colours 
instead.
The rationale here being that even in the normal scenario it seems with 
modern
excel documents the note background colour is a 'real' colour and not an 
index
( therefore the colour selection from some predefined colour doesn't happen 
)
But the note text colour is generally a colour index ( therefore a colour is
selected from defaults ). In say gnome3 the default tooltip colour is now 
white
 and a really bad contrast to the normal background colour for a note. I 
changed
the code here to use the colours from libreoffice given that the default 
colours
more or less match Excel default colours ( which will be by far the most
frequently ) used combination

Change-Id: I2ae38a44e0cbf201beb3b7d18a89f5ebdd644f8c
Reviewed-on: https://gerrit.libreoffice.org/3814
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/filter/excel/xlstyle.cxx 
b/sc/source/filter/excel/xlstyle.cxx
index a6a39ed..e2b3f18 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -27,11 +27,11 @@
 #include vcl/font.hxx
 #include sal/macros.h
 #include rtl/tencinfo.h
+#include svtools/colorcfg.hxx
 #include toolkit/unohlp.hxx
 #include editeng/svxfont.hxx
 #include global.hxx
 #include xlroot.hxx
-
 // Color data =
 
 /** Standard EGA colors, bright. */
@@ -94,8 +94,22 @@ XclDefaultPalette::XclDefaultPalette( const XclRoot rRoot ) 
:
 mnWindowText = rSett.GetWindowTextColor().GetColor();
 mnWindowBack = rSett.GetWindowColor().GetColor();
 mnFaceColor = rSett.GetFaceColor().GetColor();
-mnNoteText = rSett.GetHelpTextColor().GetColor();
-mnNoteBack = rSett.GetHelpColor().GetColor();
+// Don't use the system HelpBack and HelpText colours as it causes problems
+// with modern gnome. This is because mnNoteText and mnNoteBack are used
+// when colour indices ( instead of real colours ) are specified.
+// Note: That this it is not an unusual scenario that we get the Note
+// background specified as a real colour and the text specified as a
+// colour index. That means the text colour would be picked from
+// the system where the note background would be picked from a real colour.
+// Previously the the note text colour was picked from the system tooltip
+// text colour, on modern gnome(e.g. 3) that tends to be 'white' with the
+// default theme.
+// Using the the Libreoffice defaults ( instead of system specific colours
+// ) lessens the chance of the one colour being an unsuitable combination
+// because by default the note text is black and the note background is
+// a light yellow colour ( very similar to Excel's normal defaults )
+mnNoteText =  svtools::ColorConfig::GetDefaultColor( svtools::FONTCOLOR 
).GetColor();
+mnNoteBack =  svtools::ColorConfig::GetDefaultColor( 
svtools::CALCNOTESBACKGROUND ).GetColor();
 
 // default colors
 switch( rRoot.GetBiff() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-11 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit f21815f9fe2609dd4ea152c65bb98b77b0a141f7
Author: Eike Rathke er...@redhat.com
Date:   Fri May 10 18:13:07 2013 +0200

resolved fdo#64384 check subtotal row filtered also for single reference

(cherry picked from commit 3c2d0acc871057573fe9ab45b8161fce70190e80)

Conflicts:
sc/source/core/tool/interpr1.cxx

Change-Id: Ic00b9135021f2c5f76755efbe88fc1f12e655320
Reviewed-on: https://gerrit.libreoffice.org/3847
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 3ed9189..994bc2b 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -3990,6 +3990,10 @@ double ScInterpreter::IterateParameters( ScIterFunc 
eFunc, bool bTextAsZero )
 ++nCount;
 break;
 }
+if (glSubTotal  pDok-RowFiltered( aAdr.Row(), aAdr.Tab()))
+{
+break;
+}
 ScBaseCell* pCell = GetCell( aAdr );
 if ( pCell )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-09 Thread Sameer Deshmukh
 sc/source/ui/view/tabview.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 07a14c901025722bcc0a06c76e83c40985ca01a6
Author: Sameer Deshmukh sameer.deshmuk...@gmail.com
Date:   Sun Apr 28 02:15:50 2013 +0530

fdo#61060 - Freezing now marks spreadsheet as unsaved.

Change-Id: I0b479500938e185fb6d163837b29e6e36e823260
Reviewed-on: https://gerrit.libreoffice.org/3641
Reviewed-by: Tor Lillqvist t...@iki.fi
Tested-by: Tor Lillqvist t...@iki.fi
Signed-off-by: Michael Meeks michael.me...@suse.com

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 0deadab..9bd2105 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2032,6 +2032,7 @@ void ScTabView::FreezeSplitters( bool bFreeze )
 if ( bFreeze )
 {
 Point aWinStart = pWin-GetPosPixel();
+aViewData.GetDocShell()-SetDocumentModified();
 
 Point aSplit;
 SCsCOL nPosX;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-07 Thread Albert Thuswaldner
 sc/source/ui/dbgui/tpsort.cxx |   40 
 sc/source/ui/inc/tpsort.hxx   |1 +
 2 files changed, 25 insertions(+), 16 deletions(-)

New commits:
commit 104edfdc77147b49f32df55e8b48a3aef4542c87
Author: Albert Thuswaldner albert.thuswald...@gmail.com
Date:   Sat May 4 01:39:24 2013 +0200

fdo#51828 - UI: Sort: can use more than 3 criteria once only - additional 
fix

Change-Id: I220b3755d3ea30bd9aa25b175f7f3eea7590ebdb
Reviewed-on: https://gerrit.libreoffice.org/3801
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 4ee9d11..034afec 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -184,7 +184,6 @@ void ScTabPageSortFields::Reset( const SfxItemSet /* 
rArgSet */ )
 {
 maSortKeyItems[i].m_pLbSort-SelectEntryPos( GetFieldSelPos(
 aSortData.maKeyState[i].nField ) );
-
 (aSortData.maKeyState[i].bAscending)
 ? maSortKeyItems[i].m_pBtnUp-Check()
 : maSortKeyItems[i].m_pBtnDown-Check();
@@ -234,6 +233,10 @@ void ScTabPageSortFields::Reset( const SfxItemSet /* 
rArgSet */ )
 pDlg-SetByRows ( bSortByRows );
 pDlg-SetHeaders( bHasHeader );
 }
+
+// Make sure that there is always a last undefined sort key
+if ( maSortKeyItems[nSortKeyCount - 1].m_pLbSort-GetSelectEntryPos()  0 )
+SetLastSortKey( nSortKeyCount );
 }
 
 // ---
@@ -443,6 +446,25 @@ sal_uInt16 ScTabPageSortFields::GetFieldSelPos( SCCOLROW 
nField )
 return nFieldPos;
 }
 
+void ScTabPageSortFields::SetLastSortKey( sal_uInt16 nItem )
+{
+// Extend local SortParam copy
+const ScSortKeyState atempKeyState = { false, 0, true };
+aSortData.maKeyState.push_back( atempKeyState );
+
+// Add Sort Key Item
+++nSortKeyCount;
+maSortKeyCtrl.AddSortKey( nSortKeyCount );
+maSortKeyItems[nItem].m_pLbSort-SetSelectHdl(
+ LINK( this, ScTabPageSortFields, SelectHdl ) );
+
+FillFieldLists( nItem );
+
+// Set Status
+maSortKeyItems[nItem].m_pBtnUp-Check();
+maSortKeyItems[nItem].m_pLbSort-SelectEntryPos( 0 );
+}
+
 // ---
 // Handler:
 //-
@@ -451,26 +473,12 @@ IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb 
)
 {
 rtl::OUString aSelEntry = pLb-GetSelectEntry();
 ScSortKeyItems::iterator pIter;
-sal_uInt16 nSortKeyIndex = nSortKeyCount;
 
 // If last listbox is enabled add one item
 if ( maSortKeyItems.back().m_pLbSort == pLb )
 if ( aSelEntry != aStrUndefined )
 {
-// Extend local SortParam copy
-const ScSortKeyState atempKeyState = { false, 0, true };
-aSortData.maKeyState.push_back( atempKeyState );
-
-// Add Sort Key Item
-++nSortKeyCount;
-maSortKeyCtrl.AddSortKey( nSortKeyCount );
-maSortKeyItems[nSortKeyIndex].m_pLbSort-SetSelectHdl( LINK( this, 
ScTabPageSortFields, SelectHdl ) );
-
-FillFieldLists( nSortKeyIndex );
-
-// Set Status
-maSortKeyItems[nSortKeyIndex].m_pBtnUp-Check();
-maSortKeyItems[nSortKeyIndex].m_pLbSort-SelectEntryPos( 0 );
+SetLastSortKey( nSortKeyCount );
 return 0;
 }
 
diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx
index 8ce4a42..b230581 100644
--- a/sc/source/ui/inc/tpsort.hxx
+++ b/sc/source/ui/inc/tpsort.hxx
@@ -95,6 +95,7 @@ private:
 voidInit();
 voidFillFieldLists  ( sal_uInt16 nStartField );
 sal_uInt16  GetFieldSelPos  ( SCCOLROW nField );
+voidSetLastSortKey( sal_uInt16 nItem );
 
 // Handler 
 DECL_LINK( SelectHdl, ListBox * );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-06 Thread Faisal M . Al-Otaibi
 sc/source/ui/view/drawview.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 0618ebfa88b1b3eca11f40c173a53680cd41dedd
Author: Faisal M. Al-Otaibi fmalota...@kacst.edu.sa
Date:   Sun May 5 09:49:30 2013 +0300

fdo#63878 fix the zoom problem when the sheet are RTL

Change-Id: Ie451b7a84b5481e9209c5b6d6d439844de5082fd
Reviewed-on: https://gerrit.libreoffice.org/3789
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com
(cherry picked from commit 5bff7f52075eb3ffe931d1779681262e1820a859)

Signed-off-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 6900932..7e4555d 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -791,6 +791,9 @@ void ScDrawView::SyncForGrid( SdrObject* pObj )
 Point aCurPos =  pViewData-GetScrPos(  aOldStt.Col(), aOldStt.Row(), 
eWhich, sal_True );
 Point aCurPosHmm = pGridWin-PixelToLogic(aCurPos, aDrawMode );
 Point aGridOff = ( aCurPosHmm - aOldPos );
+// fdo#63878 Fix the X position for RTL Sheet
+if( aGridOff.getX()  0 )
+aGridOff.setX( aCurPosHmm.getX() + aOldPos.getX() );
 pObj-SetGridOffset( aGridOff );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-05-03 Thread Michael Meeks
 sc/source/ui/vba/vbarange.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0849bd9c5ef5ac885527cb98dafb9cea6200d8e5
Author: Michael Meeks michael.me...@suse.com
Date:   Thu May 2 16:21:35 2013 +0100

fdo#64048 - fix calc/VBA clearcontents regression.

Change-Id: Id0c07507810ec1db41359f39dee804364fd37ecd
Reviewed-on: https://gerrit.libreoffice.org/3744
Reviewed-by: Noel Power noel.po...@suse.com
Tested-by: Noel Power noel.po...@suse.com

diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index abbe31e..d8a42bf 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -1636,7 +1636,7 @@ void SAL_CALL
 ScVbaRange::ClearContents() throw (uno::RuntimeException)
 {
 using namespace ::com::sun::star::sheet::CellFlags;
-sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA | HARDATTR | 
EDITATTR | FORMATTED;
+sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA;
 ClearContents( nFlags, true );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-29 Thread Caolán McNamara
 sc/source/ui/condformat/condformatdlg.cxx |   10 +++---
 sc/source/ui/inc/condformatdlg.hxx|4 ++--
 sc/source/ui/src/condformatdlg.src|4 
 3 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 24eb9d6f32397dabf5e52671090fd7607bcc1cf2
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Apr 29 10:07:47 2013 +0100

Resolves: fdo#51556 allow tab traversing into the conditional formatting 
list

Change-Id: Ie08a7312df0d42efc3697089cf766ceeefd623b0
(cherry picked from commit f0596516b943f90632ff4bbca83f4ce825e3b433)
Reviewed-on: https://gerrit.libreoffice.org/3656
Reviewed-by: Tor Lillqvist t...@iki.fi
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/ui/condformat/condformatdlg.cxx 
b/sc/source/ui/condformat/condformatdlg.cxx
index 1af8118..d0052a0 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -128,7 +128,6 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const 
ResId rResId, ScDocum
 maEntries.begin()-SetActive();
 
 RecalcAll();
-FreeResource();
 }
 
 ScConditionalFormat* ScCondFormatList::GetConditionalFormat() const
@@ -343,6 +342,9 @@ IMPL_LINK( ScCondFormatList, EntrySelectHdl, 
ScCondFrmtEntry*, pEntry )
 if(pEntry-IsSelected())
 return 0;
 
+//A child has focus, but we will hide that, so regrab to whatever new 
thing gets
+//shown instead of leaving it stuck in the inaccessible hidden element
+bool bReGrabFocus = HasChildPathFocus();
 for(EntryContainer::iterator itr = maEntries.begin(); itr != 
maEntries.end(); ++itr)
 {
 itr-SetInactive();
@@ -350,6 +352,8 @@ IMPL_LINK( ScCondFormatList, EntrySelectHdl, 
ScCondFrmtEntry*, pEntry )
 static_castScCondFormatDlg*(GetParent())-InvalidateRefData();
 pEntry-SetActive();
 RecalcAll();
+if (bReGrabFocus)
+GrabFocus();
 return 0;
 }
 
@@ -368,11 +372,11 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, 
ScDocument* pDoc, const ScCond
 ScAnyRefModalDlg(pParent, ScResId(RID_SCDLG_CONDFORMAT) ),
 maBtnAdd( this, ScResId( BTN_ADD ) ),
 maBtnRemove( this, ScResId( BTN_REMOVE ) ),
-maBtnOk( this, ScResId( BTN_OK ) ),
-maBtnCancel( this, ScResId( BTN_CANCEL ) ),
 maFtRange( this, ScResId( FT_RANGE ) ),
 maEdRange( this, this, ScResId( ED_RANGE ) ),
 maRbRange( this, ScResId( RB_RANGE ), maEdRange, this ),
+maBtnOk( this, ScResId( BTN_OK ) ),
+maBtnCancel( this, ScResId( BTN_CANCEL ) ),
 maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, rPos, 
eType ),
 maPos(rPos),
 mpDoc(pDoc),
diff --git a/sc/source/ui/inc/condformatdlg.hxx 
b/sc/source/ui/inc/condformatdlg.hxx
index 68651ff..0b0bdb9 100644
--- a/sc/source/ui/inc/condformatdlg.hxx
+++ b/sc/source/ui/inc/condformatdlg.hxx
@@ -101,11 +101,11 @@ class ScCondFormatDlg : public ScAnyRefModalDlg
 private:
 PushButton maBtnAdd;
 PushButton maBtnRemove;
-OKButton maBtnOk;
-CancelButton maBtnCancel;
 FixedText maFtRange;
 formula::RefEdit maEdRange;
 formula::RefButton maRbRange;
+OKButton maBtnOk;
+CancelButton maBtnCancel;
 
 ScCondFormatList maCondFormList;
 
diff --git a/sc/source/ui/src/condformatdlg.src 
b/sc/source/ui/src/condformatdlg.src
index 53df59c..c280ddf 100644
--- a/sc/source/ui/src/condformatdlg.src
+++ b/sc/source/ui/src/condformatdlg.src
@@ -66,6 +66,7 @@ ModalDialog RID_SCDLG_CONDFORMAT
 {
 Pos = MAP_APPFONT( 5, 20 );
 Size = MAP_APPFONT( 290, 220 );
+DialogControl = TRUE;
 Border = TRUE;
 };
 FixedText FT_RANGE
@@ -79,12 +80,14 @@ ModalDialog RID_SCDLG_CONDFORMAT
 Pos = MAP_APPFONT( 60, 262 );
 Size = MAP_APPFONT( 182, 14 );
 Border = TRUE;
+TabStop = TRUE;
 };
 ImageButton RB_RANGE
 {
 Pos = MAP_APPFONT( 245, 262 );
 Size = MAP_APPFONT( 14, 14 );
 Border = TRUE;
+TabStop = TRUE;
 };
 };
 
@@ -93,6 +96,7 @@ Control RID_COND_ENTRY
 Pos = MAP_APPFONT( 0, 0 );
 Size = MAP_APPFONT( 290, 40 );
 Border = TRUE;
+DialogControl = TRUE;
 
 FixedText FT_COND_NR
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-24 Thread Eike Rathke
 sc/source/core/data/column2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1545e404ee0901c861da6e02140a49ebf6b88eec
Author: Eike Rathke er...@redhat.com
Date:   Tue Apr 23 18:09:43 2013 +0200

fixed out of bounds vector access

in ScColumn::FindNextVisibleRowWithContent() if starting from the
position all including the last present cell of a column are blank

Change-Id: I0270331444f1707b6ad413f6127ae4c2cf0b1984
(cherry picked from commit 3874bad70ea48deed91b9966b3d35782b5584f7d)
Reviewed-on: https://gerrit.libreoffice.org/3584
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 2bdb401..c782f89 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1347,7 +1347,7 @@ SCROW ScColumn::FindNextVisibleRowWithContent(SCROW nRow, 
bool bForward) const
 bool bThere = Search( nRow, nIndex );
 if( bThere  !maItems[nIndex].pCell-IsBlank())
 return nRow;
-else if(nIndex = maItems.size())
+else if((bThere ? nIndex+1 : nIndex) = maItems.size())
 return MAXROW;
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-16 Thread Kohei Yoshida
 sc/source/ui/dbgui/dapitype.cxx |4 
 sc/source/ui/dbgui/dapitype.src |2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit c7838491f7c1fc1de6a11983e4bdee7692619bba
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Mon Apr 15 21:30:18 2013 -0400

Remove the 4th option from the pivot table source selection dialog.

Change-Id: I39ed1a9fd0476506cac0852af63182075f433ffd
Reviewed-on: https://gerrit.libreoffice.org/3402
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx
index cad3532..e17d1e0 100644
--- a/sc/source/ui/dbgui/dapitype.cxx
+++ b/sc/source/ui/dbgui/dapitype.cxx
@@ -62,6 +62,10 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg( Window* 
pParent, sal_Bool bE
 aBtnNamedRange.Disable();
 
 FreeResource();
+
+ // Intentionally hide this to see if someone complains. Eventually we'll
+ // remove this option.
+aBtnExternal.Show(false);
 }
 
 ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg()
diff --git a/sc/source/ui/dbgui/dapitype.src b/sc/source/ui/dbgui/dapitype.src
index 569023d..4a388d6 100644
--- a/sc/source/ui/dbgui/dapitype.src
+++ b/sc/source/ui/dbgui/dapitype.src
@@ -26,7 +26,7 @@ ModalDialog RID_SCDLG_DAPITYPE
 OutputSize = TRUE ;
 HelpId = HID_DATAPILOT_TYPE ;
 SVLook = TRUE ;
-Size = MAP_APPFONT ( 241 , 76 ) ;
+Size = MAP_APPFONT ( 241 , 63 ) ;
 Moveable = TRUE ;
 Closeable = FALSE ;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-15 Thread Eike Rathke
 sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx |   91 +-
 1 file changed, 64 insertions(+), 27 deletions(-)

New commits:
commit a580678e8719d08ef9355b714f840837e89bd5b3
Author: Eike Rathke er...@redhat.com
Date:   Sat Apr 13 16:15:24 2013 +0200

resolved fdo#63421 crash in pivot table with accessibility

The scenario of fdo#63421 (loading data and re-dragging the same field)
is not needed, simple data is sufficient and crash happened also when
dragging (removing) a field from a pane and dropping it anywhere else.

Multiple errors:
* getAccessibleChildCount() must return the real current count of
  children, not what mpFieldWindow says; AtkListener::updateChildList()
  uses this value to repopulate its own list; a child is added after it
  is added to mpFieldWindow but removed before it is removed from
  mpFieldWindow;
* LostFocus() uses an index of -1 if the last child was already removed
  and the field was dropped after dragging it away from a pane, handle
  that but it still does not look right
* RemoveField() called CommitChange() with
  AccessibleEventObject::NewValue set instead of OldValue, leading to
  AtkListener::handleChildAdded() being called instead of
  handleChildRemoved()

Apparently this never worked since 2002.

Change-Id: Idfb59d947002d2212bc67b414daecb65c55edae8
(cherry picked from commit 26114dcdf9d55a5a2490de6de619337e9733b0e2)
Reviewed-on: https://gerrit.libreoffice.org/3372
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx 
b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
index 035004ae..8490572 100644
--- a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
@@ -259,7 +259,7 @@ void ScAccessibleDataPilotControl::RemoveField(sal_Int32 
nOldIndex)
 AccessibleEventObject aEvent;
 aEvent.EventId = AccessibleEventId::CHILD;
 aEvent.Source = uno::Reference XAccessibleContext (this);
-aEvent.NewValue = xTempAcc;
+aEvent.OldValue = xTempAcc;
 
 CommitChange(aEvent); // gone child - event
 
@@ -270,25 +270,41 @@ void ScAccessibleDataPilotControl::RemoveField(sal_Int32 
nOldIndex)
 
 void ScAccessibleDataPilotControl::FieldFocusChange(sal_Int32 nOldIndex, 
sal_Int32 nNewIndex)
 {
-OSL_ENSURE(static_castsize_t(nOldIndex)  maChildren.size() 
-static_castsize_t(nNewIndex)  maChildren.size(), did not 
recognize a child count change);
-
-uno::Reference  XAccessible  xTempAcc = maChildren[nOldIndex].xWeakAcc;
-if (xTempAcc.is()  maChildren[nOldIndex].pAcc)
-maChildren[nOldIndex].pAcc-ResetFocused();
+if (0 = nOldIndex  static_castsize_t(nOldIndex)  maChildren.size())
+{
+uno::Reference  XAccessible  xTempAcc = 
maChildren[nOldIndex].xWeakAcc;
+if (xTempAcc.is()  maChildren[nOldIndex].pAcc)
+maChildren[nOldIndex].pAcc-ResetFocused();
+}
+else
+{
+SAL_WARN( sc, ScAccessibleDataPilotControl::FieldFocusChange() old 
index out of bounds:   nOldIndex);
+}
 
-xTempAcc = maChildren[nNewIndex].xWeakAcc;
-if (xTempAcc.is()  maChildren[nNewIndex].pAcc)
-maChildren[nNewIndex].pAcc-SetFocused();
+if (0 = nNewIndex  static_castsize_t(nNewIndex)  maChildren.size())
+{
+uno::Reference  XAccessible  xTempAcc = 
maChildren[nNewIndex].xWeakAcc;
+if (xTempAcc.is()  maChildren[nNewIndex].pAcc)
+maChildren[nNewIndex].pAcc-SetFocused();
+}
+else
+{
+SAL_WARN( sc, ScAccessibleDataPilotControl::FieldFocusChange() new 
index out of bounds:   nNewIndex);
+}
 }
 
 void ScAccessibleDataPilotControl::FieldNameChange(sal_Int32 nIndex)
 {
-OSL_ENSURE(static_castsize_t(nIndex)  maChildren.size(), did not 
recognize a child count change);
-
-uno::Reference  XAccessible  xTempAcc = maChildren[nIndex].xWeakAcc;
-if (xTempAcc.is()  maChildren[nIndex].pAcc)
-maChildren[nIndex].pAcc-ChangeName();
+if (0 = nIndex  static_castsize_t(nIndex)  maChildren.size())
+{
+uno::Reference  XAccessible  xTempAcc = maChildren[nIndex].xWeakAcc;
+if (xTempAcc.is()  maChildren[nIndex].pAcc)
+maChildren[nIndex].pAcc-ChangeName();
+}
+else
+{
+SAL_WARN( sc, ScAccessibleDataPilotControl::FieldNameChange() index 
out of bounds:   nIndex);
+}
 }
 
 void ScAccessibleDataPilotControl::GotFocus()
@@ -298,9 +314,16 @@ void ScAccessibleDataPilotControl::GotFocus()
 OSL_ENSURE(mpFieldWindow-GetFieldCount() == maChildren.size(), did 
not recognize a child count change);
 
 sal_Int32 nIndex(mpFieldWindow-GetSelectedField());
-uno::Reference  XAccessible  xTempAcc = maChildren[nIndex].xWeakAcc;
- 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-13 Thread Noel Power
 sc/source/ui/vba/vbavalidation.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 1666281eeafa9e3299c85dfca5d92d53bac40cad
Author: Noel Power noel.po...@suse.com
Date:   Fri Apr 5 21:02:16 2013 +0100

somewhat blind wae fix ( doesn't happen for me )

Change-Id: Ia9b260c8bf2dc948f155fb89f0b5d960f9aada6f
(cherry picked from commit 9c79ec29dba9dbdc6dc56f6e83b09f5176821768)

Signed-off-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/ui/vba/vbavalidation.cxx 
b/sc/source/ui/vba/vbavalidation.cxx
index 7431370..b318c8d 100644
--- a/sc/source/ui/vba/vbavalidation.cxx
+++ b/sc/source/ui/vba/vbavalidation.cxx
@@ -369,6 +369,9 @@ ScVbaValidation::getType() throw (uno::RuntimeException)
 case sheet::ValidationType_TEXT_LEN:
 nExcelType = excel::XlDVType::xlValidateTextLength;
 break;
+case sheet::ValidationType_MAKE_FIXED_SIZE:
+default:
+break;
 };
 }
 return nExcelType;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-11 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |   14 ++
 sc/source/core/tool/scmatrix.cxx |   15 ---
 2 files changed, 26 insertions(+), 3 deletions(-)

New commits:
commit 92b0c257cbe590d345adbaddbebebe95f977d8d5
Author: Eike Rathke er...@redhat.com
Date:   Thu Apr 11 01:29:22 2013 +0200

resolved fdo#63403 do not create matrix with 0 rows or cols

Change-Id: Icbbde3723c1b37713d0f26ef8305c4a199b8
(cherry picked from commit 7c3ab3bc15cec211767490823539efcada4fe964)
Reviewed-on: https://gerrit.libreoffice.org/3321
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 1553a9b..3ed9189 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4591,6 +4591,13 @@ void ScInterpreter::ScColumn()
 SCCOL nCols;
 SCROW nRows;
 pMyFormulaCell-GetMatColsRows( nCols, nRows);
+if (nCols == 0)
+{
+// Happens if called via ScViewFunc::EnterMatrix()
+// ScFormulaCell::GetResultDimensions() as of course a
+// matrix result is not available yet.
+nCols = 1;
+}
 ScMatrixRef pResMat = GetNewMat( static_castSCSIZE(nCols), 
1);
 if (pResMat)
 {
@@ -4667,6 +4674,13 @@ void ScInterpreter::ScRow()
 SCCOL nCols;
 SCROW nRows;
 pMyFormulaCell-GetMatColsRows( nCols, nRows);
+if (nRows == 0)
+{
+// Happens if called via ScViewFunc::EnterMatrix()
+// ScFormulaCell::GetResultDimensions() as of course a
+// matrix result is not available yet.
+nRows = 1;
+}
 ScMatrixRef pResMat = GetNewMat( 1, 
static_castSCSIZE(nRows));
 if (pResMat)
 {
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 0a92ffc..e6c2240 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -1128,17 +1128,26 @@ size_t ScMatrixImpl::Count(bool bCountStrings) const
 void ScMatrixImpl::CalcPosition(SCSIZE nIndex, SCSIZE rC, SCSIZE rR) const
 {
 SCSIZE nRowSize = maMat.size().row;
-rC = nIndex / nRowSize;
+SAL_WARN_IF( !nRowSize, sc, ScMatrixImpl::CalcPosition: 0 rows!);
+rC = nRowSize  1 ? nIndex / nRowSize : nIndex;
 rR = nIndex - rC*nRowSize;
 }
 
 // 
 
 ScMatrix::ScMatrix( SCSIZE nC, SCSIZE nR) :
-pImpl(new ScMatrixImpl(nC, nR)), nRefCnt(0) {}
+pImpl(new ScMatrixImpl(nC, nR)), nRefCnt(0)
+{
+SAL_WARN_IF( !nC, sc, ScMatrix with 0 columns!);
+SAL_WARN_IF( !nR, sc, ScMatrix with 0 rows!);
+}
 
 ScMatrix::ScMatrix(SCSIZE nC, SCSIZE nR, double fInitVal) :
-pImpl(new ScMatrixImpl(nC, nR, fInitVal)), nRefCnt(0) {}
+pImpl(new ScMatrixImpl(nC, nR, fInitVal)), nRefCnt(0)
+{
+SAL_WARN_IF( !nC, sc, ScMatrix with 0 columns!);
+SAL_WARN_IF( !nR, sc, ScMatrix with 0 rows!);
+}
 
 ScMatrix::~ScMatrix()
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-11 Thread Eike Rathke
 sc/source/core/data/dpoutput.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 86cb5a1d0f980633754fe250c636935c028f0f82
Author: Eike Rathke er...@redhat.com
Date:   Thu Apr 11 15:24:38 2013 +0200

prevent out of bounds vector access in ooo62493-1.xls recalculation

The document https://issues.apache.org/ooo/attachment.cgi?id=34418
attached to https://issues.apache.org/ooo/show_bug.cgi?id=62493 crashes
in a dbgutil build due to an invalid subtotal count that leads to an out
of bounds access in a vector, in this case with offset -1

This fixes the symptom, not the cause why the subtotal count would be
wrong.

Change-Id: If96c2eadba8753ea3e3166db0a81441818c89b2d
(cherry picked from commit 58885eda4f15913fc46243dab726632f5904aab5)
Reviewed-on: https://gerrit.libreoffice.org/3336
Reviewed-by: Kohei Yoshida kohei.yosh...@gmail.com
Tested-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index d78f83e..a59fc77 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -1822,6 +1822,8 @@ void lcl_StripSubTotals( std::vectorbool rResult, 
const std::vectorsal_Int32
 // if a subtotal is included, clear the result flag for the 
columns/rows that the subtotal includes
 sal_Int32 nStart = nPos - rSubtotal[nPos];
 OSL_ENSURE( nStart = 0, invalid subtotal count );
+if (nStart  0)
+nStart = 0;
 
 for (sal_Int32 nPrev = nStart; nPrev  nPos; nPrev++)
 rResult[nPrev] = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-11 Thread Eike Rathke
 sc/source/core/data/dpoutput.cxx |   54 ++-
 1 file changed, 42 insertions(+), 12 deletions(-)

New commits:
commit e58a8b6d7dc1b01af9f54bec8fdce718b1d8bccd
Author: Eike Rathke er...@redhat.com
Date:   Thu Apr 11 16:50:15 2013 +0200

prevent vector and sequence out of bounds access, fdo#60300

This fixes the symptom of the crash but not the underlying cause why a
subtotal count would be wrong.

(cherry picked from commit 8bd3be9915ff28458d010fc8f0a1a1ab66d730b0)

Conflicts:
sc/source/core/data/dpoutput.cxx

Change-Id: I3782b5e39f18bc65ffe510b847ffa7969a26cd37
Reviewed-on: https://gerrit.libreoffice.org/3340
Reviewed-by: Kohei Yoshida kohei.yosh...@gmail.com
Tested-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index a59fc77..72fe4de 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -1707,11 +1707,19 @@ void lcl_FilterInclude( std::vectorbool rResult, 
std::vector sal_Int32  rS
 {
 // grand total is always automatic
 sal_Int32 nDataPos = j - ( nSize - nGrandTotals );
-OSL_ENSURE( nDataPos  (sal_Int32)rDataNames.size(), 
wrong data count );
-rtl::OUString aSourceName( rDataNames[nDataPos] ); // 
vector contains source names
-rtl::OUString aGivenName( rGivenNames[nDataPos] );
+if (nDataPos = 0  nDataPos  
(sal_Int32)rDataNames.size() 
+nDataPos  (sal_Int32)rGivenNames.size())
+{
+OUString aSourceName( rDataNames[nDataPos] ); // 
vector contains source names
+OUString aGivenName( rGivenNames[nDataPos] );
 
-rResult[j] = lcl_IsNamedDataField( rTarget, aSourceName, 
aGivenName );
+rResult[j] = lcl_IsNamedDataField( rTarget, 
aSourceName, aGivenName );
+}
+else
+{
+OSL_FAIL( wrong data count for grand total );
+rResult[j] = false;
+}
 }
 }
 
@@ -1747,27 +1755,49 @@ void lcl_FilterInclude( std::vectorbool rResult, 
std::vector sal_Int32  rS
 rtl::OUString aSourceName( rDataNames[nDataPos] ); 
// vector contains source names
 rtl::OUString aGivenName( rGivenNames[nDataPos] );
 
-OSL_ENSURE( nFuncPos  aSubTotals.getLength(), wrong 
subtotal count );
-rResult[j] = lcl_IsNamedDataField( rTarget, 
aSourceName, aGivenName ) 
+if (nFuncPos  aSubTotals.getLength())
+{
+rResult[j] = lcl_IsNamedDataField( rTarget, 
aSourceName, aGivenName ) 
  aSubTotals[nFuncPos] == 
aFilter.meFunction;
+}
+else
+{
+OSL_FAIL( wrong subtotal count for manual 
subtotals and several data fields );
+rResult[j] = false;
+}
 }
 else
 {
 // manual subtotals for a single data field
 
-OSL_ENSURE( nSubTotalCount  aSubTotals.getLength(), 
wrong subtotal count );
-rResult[j] = ( aSubTotals[nSubTotalCount] == 
aFilter.meFunction );
+if (nSubTotalCount  aSubTotals.getLength())
+{
+rResult[j] = ( aSubTotals[nSubTotalCount] == 
aFilter.meFunction );
+}
+else
+{
+OSL_FAIL( wrong subtotal count for manual 
subtotals for a single data field );
+rResult[j] = false;
+}
 }
 }
 else// automatic subtotals
 {
 if ( rBeforeDataLayout )
 {
-OSL_ENSURE( nSubTotalCount  
(sal_Int32)rDataNames.size(), wrong data count );
-rtl::OUString aSourceName( rDataNames[nSubTotalCount] 
);   // vector contains source names
-rtl::OUString aGivenName( rGivenNames[nSubTotalCount] 
);
+if (nSubTotalCount  (sal_Int32)rDataNames.size() 
+nSubTotalCount  (sal_Int32)rGivenNames.size())
+{
+OUString aSourceName( rDataNames[nSubTotalCount] 
);   // vector contains source names
+OUString aGivenName( 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-11 Thread Albert Thuswaldner
 sc/source/ui/dbgui/tpsort.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 0ed9aab7615ae471abe1aecc4b7665c45ed85aaf
Author: Albert Thuswaldner albert.thuswald...@gmail.com
Date:   Sat Apr 6 21:43:48 2013 +0200

fdo#51828 - UI: Sort: can use more than 3 criteria once only

Change-Id: I7480e8d606e1eafde45635e36dfafa4232f529cb
Reviewed-on: https://gerrit.libreoffice.org/3217
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
Reviewed-on: https://gerrit.libreoffice.org/3350
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 78d04ac..4ee9d11 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -168,9 +168,19 @@ void ScTabPageSortFields::Reset( const SfxItemSet /* 
rArgSet */ )
 // ListBox selection:
 if ( aSortData.maKeyState[0].bDoSort )
 {
+// Make sure that the all sort keys are reset
+for ( sal_uInt16 i=nSortKeyCount; iaSortData.maKeyState.size(); i++ )
+{
+maSortKeyCtrl.AddSortKey(i+1);
+maSortKeyItems[i].m_pLbSort-SetSelectHdl( LINK( this,
+ ScTabPageSortFields, SelectHdl ) );
+}
+nSortKeyCount = aSortData.maKeyState.size();
+FillFieldLists(0);
+
 for ( sal_uInt16 i=0; inSortKeyCount; i++ )
 {
-if ( i  aSortData.maKeyState.size()  
aSortData.maKeyState[i].bDoSort )
+if (aSortData.maKeyState[i].bDoSort )
 {
 maSortKeyItems[i].m_pLbSort-SelectEntryPos( GetFieldSelPos(
 aSortData.maKeyState[i].nField ) );
@@ -193,7 +203,6 @@ void ScTabPageSortFields::Reset( const SfxItemSet /* 
rArgSet */ )
 maSortKeyItems[i].DisableField();
 else
 maSortKeyItems[i].EnableField();
-
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-09 Thread Caolán McNamara
 sc/source/ui/view/cellsh2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0e147d836c753280842463326759c9fdb56ff83a
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Apr 9 14:02:17 2013 +0100

Resolves: fdo#61948 delayed delete deletes nothing under windows

The reason there appears to be two dialogs, is because there
actually is. The original dialog doesn't get deleted under
windows.

If we use the actual returned type of the dialog here rather than a lower
baseclass then the right thing happens. Original code works under Linux but 
not
Windows.

Change-Id: Iaf99fa4e16f743b1f5a3d29f42a140491f3d67b0
(cherry picked from commit afb3af7ce5fef803d42a549095863e6bb8210ef2)
Reviewed-on: https://gerrit.libreoffice.org/3288
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 1ab57f6..0e4a720 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -178,7 +178,7 @@ namespace
 {
 long DelayDeleteAbstractDialog( void *pAbstractDialog, void * /*pArg*/ )
 {
-delete reinterpret_castVclAbstractDialog*( pAbstractDialog );
+delete reinterpret_castSfxAbstractTabDialog*( pAbstractDialog );
 return 0;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-08 Thread Irányossy Knoblauch Artúr
 sc/source/filter/excel/xeview.cxx |5 +++--
 sc/source/filter/inc/xeview.hxx   |1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 0c96156ec20b0092e7909cc06e1f0c5c4d29a05d
Author: Irányossy Knoblauch Artúr ikar...@gmail.com
Date:   Sat Apr 6 10:13:24 2013 +0200

fdo#49120 - Implementig XML_state

Change-Id: If4779aeb5301bb3e422ceb6a4029ddf5542ab03d
Reviewed-on: https://gerrit.libreoffice.org/3222
Reviewed-by: Németh László nem...@numbertext.org
Tested-by: Németh László nem...@numbertext.org
Signed-off-by: Andras Timar ati...@suse.com

diff --git a/sc/source/filter/excel/xeview.cxx 
b/sc/source/filter/excel/xeview.cxx
index ba3a095..5ae744f 100644
--- a/sc/source/filter/excel/xeview.cxx
+++ b/sc/source/filter/excel/xeview.cxx
@@ -165,7 +165,8 @@ XclExpPane::XclExpPane( const XclTabViewData rData ) :
 mnSplitX( rData.mnSplitX ),
 mnSplitY( rData.mnSplitY ),
 maSecondXclPos( rData.maSecondXclPos ),
-mnActivePane( rData.mnActivePane )
+mnActivePane( rData.mnActivePane ),
+mbFrozenPanes( rData.mbFrozenPanes )
 {
 OSL_ENSURE( rData.IsSplit(), XclExpPane::XclExpPane - no PANE record for 
unsplit view );
 }
@@ -189,7 +190,7 @@ void XclExpPane::SaveXml( XclExpXmlStream rStrm )
 XML_ySplit, OString::valueOf( (sal_Int32)mnSplitY 
).getStr(),
 XML_topLeftCell,XclXmlUtils::ToOString( maSecondXclPos 
).getStr(),
 XML_activePane, lcl_GetActivePane( mnActivePane ),
-// OOXTODO: XML_state,
+XML_state,  mbFrozenPanes ? frozen : split,
 FSEND );
 }
 
diff --git a/sc/source/filter/inc/xeview.hxx b/sc/source/filter/inc/xeview.hxx
index 07a0b0c..ab53e6d 100644
--- a/sc/source/filter/inc/xeview.hxx
+++ b/sc/source/filter/inc/xeview.hxx
@@ -103,6 +103,7 @@ private:
 sal_uInt32  mnSplitY;   /// Split Y position, or frozen 
row.
 XclAddress  maSecondXclPos; /// First visible cell in 
additional panes.
 sal_uInt8   mnActivePane;   /// Active pane (with cell cursor).
+boolmbFrozenPanes;  /// true = frozen panes; false = 
split window.
 };
 
 // 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-04-05 Thread Michael Meeks
 sc/source/core/tool/addincol.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 19d9d212615714e1bfbbf2fc83f3c057163bb1d6
Author: Michael Meeks michael.me...@suse.com
Date:   Fri Apr 5 15:21:33 2013 +0100

fdo#62155 - band-aid crash from poor addin registration on upgrade

For some sadly unknown reason we get an exception traversing the
calc addins and crashing doesn't seem a great response to that.

Change-Id: I8d1eda7c8bab384817f19a86607c7035e4c3a8ab
Reviewed-on: https://gerrit.libreoffice.org/3212
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index 8f63781..6c92d4c 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -291,6 +291,7 @@ void ScUnoAddInCollection::Initialize()
 {
 uno::Any aAddInAny = xEnum-nextElement();
 
+try
 {
 uno::Referenceuno::XInterface xIntFac;
 aAddInAny = xIntFac;
@@ -321,6 +322,8 @@ void ScUnoAddInCollection::Initialize()
 }
 }
 }
+} catch ( const uno::Exception ) {
+SAL_WARN ( sc, Failed to initialize create instance of 
sheet.AddIn );
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-27 Thread Markus Mohrhard
 sc/source/ui/view/drawvie4.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 34e356157acb91bb3c7aa48154337e4226803a40
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Mar 27 16:21:41 2013 +0100

complex categories are represented by ScRangeList

Change-Id: I35ab4e8299bb62ec0124a4c45e5cd20be6fc774a
Signed-off-by: Michael Meeks michael.me...@suse.com

diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index adf45ee..fb9f275 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -292,10 +292,13 @@ void getChartSourceRanges(ScDocument* pDoc, const 
SdrMarkList rObjs, std::vecto
 std::vectorOUString::const_iterator it = aRangeReps.begin(), itEnd = 
aRangeReps.end();
 for (; it != itEnd; ++it)
 {
-ScRange aRange;
+ScRangeList aRange;
 ScAddress aAddr;
 if (aRange.Parse(*it, pDoc, pDoc-GetAddressConvention())  SCA_VALID)
-rRanges.push_back(aRange);
+{
+for(size_t i = 0; i  aRange.size(); ++i)
+rRanges.push_back(*aRange[i]);
+}
 else if (aAddr.Parse(*it, pDoc, pDoc-GetAddressConvention())  
SCA_VALID)
 rRanges.push_back(aAddr);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-25 Thread Markus Mohrhard
 sc/source/core/data/conditio.cxx |   21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 0224cbfebdfc3f73bc870e0d039908aba879474e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 24 05:09:08 2013 +0100

URM_INSDEL we need to update the src position, fdo#62206

See ScFormulaCell::UpdateReference for a similar update

Change-Id: I1f98d26adb5085e4bdab63cc23f97a81928d6b13
(cherry picked from commit 9261c0bf6ecf6633a5577879f003edfcb569f4d7)
Reviewed-on: https://gerrit.libreoffice.org/2986
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index a6ba736..d37891a 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -526,6 +526,15 @@ void ScConditionEntry::UpdateReference( UpdateRefMode 
eUpdateRefMode,
 {
 bool bInsertTab = ( eUpdateRefMode == URM_INSDEL  nDz = 1 );
 bool bDeleteTab = ( eUpdateRefMode == URM_INSDEL  nDz = -1 );
+if(pCondFormat)
+aSrcPos = pCondFormat-GetRange().Combine().aStart;
+ScAddress aOldSrcPos = aSrcPos;
+bool bChangedPos = false;
+if(eUpdateRefMode == URM_INSDEL  rRange.In(aSrcPos))
+{
+aSrcPos.Move(nDx, nDy, nDz);
+bChangedPos = aSrcPos != aOldSrcPos;
+}
 
 bool bChanged1 = false;
 bool bChanged2 = false;
@@ -533,7 +542,7 @@ void ScConditionEntry::UpdateReference( UpdateRefMode 
eUpdateRefMode,
 if (pFormula1)
 {
 if ( bInsertTab )
-lcl_CondUpdateInsertTab( *pFormula1, rRange.aStart.Tab(), 
aSrcPos.Tab(), bChanged1, nDz );
+lcl_CondUpdateInsertTab( *pFormula1, rRange.aStart.Tab(), 
aOldSrcPos.Tab(), bChanged1, nDz );
 else
 {
 ScCompiler aComp( mpDoc, aSrcPos, *pFormula1 );
@@ -543,18 +552,18 @@ void ScConditionEntry::UpdateReference( UpdateRefMode 
eUpdateRefMode,
 else
 {
 bool bSizeChanged;
-aComp.UpdateReference( eUpdateRefMode, aSrcPos, rRange, nDx,
+aComp.UpdateReference( eUpdateRefMode, aOldSrcPos, rRange, nDx,
 nDy, nDz, bChanged1, bSizeChanged );
 }
 }
 
-if (bChanged1)
+if (bChanged1 || bChangedPos)
 DELETEZ(pFCell1);   // is created again in IsValid
 }
 if (pFormula2)
 {
 if ( bInsertTab )
-lcl_CondUpdateInsertTab( *pFormula2, rRange.aStart.Tab(), 
aSrcPos.Tab(), bChanged2, nDz );
+lcl_CondUpdateInsertTab( *pFormula2, rRange.aStart.Tab(), 
aOldSrcPos.Tab(), bChanged2, nDz );
 else
 {
 ScCompiler aComp( mpDoc, aSrcPos, *pFormula2);
@@ -564,12 +573,12 @@ void ScConditionEntry::UpdateReference( UpdateRefMode 
eUpdateRefMode,
 else
 {
 bool bSizeChanged;
-aComp.UpdateReference( eUpdateRefMode, aSrcPos, rRange, nDx,
+aComp.UpdateReference( eUpdateRefMode, aOldSrcPos, rRange, nDx,
 nDy, nDz, bChanged2, bSizeChanged );
 }
 }
 
-if (bChanged2)
+if (bChanged2 || bChangedPos)
 DELETEZ(pFCell2);   // is created again in IsValid
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-25 Thread Akash Shetye
 sc/source/core/data/global.cxx |   21 +
 1 file changed, 17 insertions(+), 4 deletions(-)

New commits:
commit 2902a8369fc6033c74ebbb46408ccb29f279a5a8
Author: Akash Shetye shetyeak...@gmail.com
Date:   Sun Mar 24 00:59:26 2013 +0530

fdo#51296 Patch accounts security setting requiring ctrl+click for 
hyperlinks.

Have used a boolean variable that acts as an entry condition to OpenURL
methods main body/code and is set on qualification of security check.

Change-Id: I1280e7cf7e8923282fda17088fd7c61fbf503b9d
(cherry picked from commit 99932fa89be0e041abf5ce5da3271600c841ff19)
Reviewed-on: https://gerrit.libreoffice.org/3032
Reviewed-by: Kohei Yoshida kohei.yosh...@gmail.com
Tested-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index e18d241..74ba29b 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -38,6 +38,7 @@
 #include sal/macros.h
 #include tools/rcid.h
 #include unotools/charclass.hxx
+#include unotools/securityoptions.hxx
 #include stdlib.h
 #include time.h
 #include ctype.h
@@ -925,13 +926,25 @@ void ScGlobal::OpenURL( const String rURL, const String 
rTarget )
 {
 //  OpenURL wird immer ueber irgendwelche Umwege durch Mausklicks im 
GridWindow
 //  aufgerufen, darum stimmen pScActiveViewShell und nScClickMouseModifier.
+//SvtSecurityOptions to access Libreoffice global security parameters
+SvtSecurityOptions aSecOpt;
+bool bProceedHyperlink = false;
+if ( (nScClickMouseModifier  KEY_MOD1)  aSecOpt.IsOptionSet( 
SvtSecurityOptions::E_CTRLCLICK_HYPERLINK )) // control-click - into new 
window
+{
+//Ctrl key is pressed and ctrl+click hyperlink security control is set
+bProceedHyperlink = true;
+}
+else if( !aSecOpt.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ) 
)
+{
+//ctrl+click hyperlink security control is disabled just click will do
+bProceedHyperlink = true;
+}
+if ( !bProceedHyperlink )
+return;
 
 SfxStringItem aUrl( SID_FILE_NAME, rURL );
 SfxStringItem aTarget( SID_TARGETNAME, rTarget );
-
-if ( nScClickMouseModifier  KEY_MOD1 ) // control-click - into new 
window
-aTarget.SetValue(rtl::OUString(_blank));
-
+aTarget.SetValue(rtl::OUString(_blank));
 SfxViewFrame* pFrame = NULL;
 String aReferName;
 if ( pScActiveViewShell )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-14 Thread Noel Power
 sc/source/filter/oox/stylesbuffer.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 8a548d2332c162d8713d266ed15aa2ff6e6a2076
Author: Noel Power noel.po...@suse.com
Date:   Wed Mar 13 12:23:41 2013 +

fix fdo#38385 - accept as valid 'start' and 'end' tokens for lineborders

Change-Id: Ie092cc09c9c6e971c4f2020cb3b233ee350752ce
(cherry picked from commit 8b29f5cb0333c156154adc151a613a547fde4f8f)
Reviewed-on: https://gerrit.libreoffice.org/2709
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/filter/oox/stylesbuffer.cxx 
b/sc/source/filter/oox/stylesbuffer.cxx
index b7cc8db..703fc8b 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1782,7 +1782,9 @@ BorderLineModel* Border::getBorderLine( sal_Int32 
nElement )
 switch( nElement )
 {
 case XLS_TOKEN( left ): return maModel.maLeft;
+case XLS_TOKEN( start ): return maModel.maLeft;
 case XLS_TOKEN( right ):return maModel.maRight;
+case XLS_TOKEN( end ):return maModel.maRight;
 case XLS_TOKEN( top ):  return maModel.maTop;
 case XLS_TOKEN( bottom ):   return maModel.maBottom;
 case XLS_TOKEN( diagonal ): return maModel.maDiagonal;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-14 Thread Wang Lei
 sc/source/core/data/dpoutput.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 0f79e6fded66af9d33350864efa4d8c1109b41e1
Author: Wang Lei l...@apache.org
Date:   Thu Jun 14 05:38:10 2012 +

i#119972 - Formula GETPIVOTDATA returns #REF! value

Patch by: pengyunquan
Review by: Wang Lei

Changed SC_UNO_LAYOUTNAME to SC_UNO_DP_LAYOUTNAME to make it compile.
(erAck)

(cherry picked from commit 166db0df90f1a5443c6914f48848891fa8016782)

Change-Id: I109885d5b2dfbb95207699a7f28741bd347e850b
Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index be2518c..d78f83e 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -1292,6 +1292,23 @@ void lcl_GetTableVars( sal_Int32 rGrandTotalCols, 
sal_Int32 rGrandTotalRows, s
 rtl::OUString aSourceName;
 rtl::OUString aGivenName;
 ScDPOutput::GetDataDimensionNames( aSourceName, 
aGivenName, xDim );
+try
+{
+uno::Any aValue = xDimProp-getPropertyValue(
+
rtl::OUString::createFromAscii(SC_UNO_DP_LAYOUTNAME) );
+
+if( aValue.hasValue() )
+{
+OUString strLayoutName;
+
+if( aValue = strLayoutName )
+if ( strLayoutName.getLength()  0 )
+aGivenName = strLayoutName;
+}
+}
+catch(uno::Exception)
+{
+}
 rDataNames.push_back( aSourceName );
 rGivenNames.push_back( aGivenName );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-12 Thread Noel Power
 sc/source/filter/excel/xetable.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 6d2a17be89e98c6a7d8c172832c9491ce6c50506
Author: Noel Power noel.po...@suse.com
Date:   Tue Mar 12 13:49:19 2013 +

fix for fdo#62111 - don't count non-default empty rows as rows to repeat

Change-Id: I075310ef63ab4eb666da2092d4be1c6f8d989b75
Reviewed-on: https://gerrit.libreoffice.org/2681
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/filter/excel/xetable.cxx 
b/sc/source/filter/excel/xetable.cxx
index c44b32c..4f5d2e40 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -2052,12 +2052,15 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData 
rDefRowData, const ScfUInt
 }
 if ( pPrev )
 {
-sal_uInt32 nRpt =  rRow-GetXclRow() - pPrev-GetXclRow();
-pPrev-SetXclRowRpt( nRpt );
-if ( nRpt  1 )
-aRepeated.push_back( pPrev );
 if ( pPrev-IsDefaultable())
 {
+// if the previous row we processed is not
+// defaultable then afaict the rows inbetween are
+// not used ( and not repeatable )
+sal_uInt32 nRpt =  rRow-GetXclRow() - pPrev-GetXclRow();
+if ( nRpt  1 )
+aRepeated.push_back( pPrev );
+pPrev-SetXclRowRpt( nRpt );
 XclExpDefaultRowData aDefData( *pPrev );
 size_t rnDefCount = aDefRowMap[ aDefData ];
 rnDefCount += ( pPrev-GetXclRowRpt() - 1 );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-11 Thread Markus Mohrhard
 sc/source/filter/xml/XMLExportIterator.cxx |   40 ++---
 sc/source/filter/xml/xmlexprt.cxx  |   15 ++
 2 files changed, 23 insertions(+), 32 deletions(-)

New commits:
commit 4428c7e9d73fd6a9722b262f2aab36c6fb8fd859
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 10 00:25:29 2013 +0100

handle note export correctly, fdo#61165

This code was horribly over-optimized and that actually with an error.
There is a nasty corner cases that has been left out in the code. Note
captions are actually normally not deleted from the document even if the
note is deleted. So we had now wrong note captions in the list that we
should not process but they were screwing up the export code that only
exports captions for existing notes.

When we only add the caption data for existing notes the code becomes so
much cleaner and the bug is immediately gone.

Change-Id: I51f1e9042f88f3f1b2d7aae75942629771d39012
(cherry picked from commit c7937e2a38501266ed658553c19db5b4a2237864)
Reviewed-on: https://gerrit.libreoffice.org/2629
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/filter/xml/XMLExportIterator.cxx 
b/sc/source/filter/xml/XMLExportIterator.cxx
index cfbbe54..1662db7 100644
--- a/sc/source/filter/xml/XMLExportIterator.cxx
+++ b/sc/source/filter/xml/XMLExportIterator.cxx
@@ -861,33 +861,21 @@ bool ScMyNotEmptyCellsIterator::GetNext(ScMyCell aCell, 
ScFormatRangeStyles* pC
 table::CellAddress  aAddress( nCurrentTable, MAXCOL + 1, MAXROW + 1 );
 
 UpdateAddress( aAddress );
-if( (maNoteExportListItr != maNoteExportList.end())  
IsNoteBeforeNextCell(maNoteExportListItr-nCol, maNoteExportListItr-nRow, 
aAddress) )
-{
-//we have a note before the new cell
-aAddress.Column = maNoteExportListItr-nCol;
-aAddress.Row = maNoteExportListItr-nRow;
-++maNoteExportListItr;
-}
-else
-{
-if(maNoteExportListItr != maNoteExportList.end()  
maNoteExportListItr-nCol == aAddress.Column  maNoteExportListItr-nRow == 
aAddress.Row)
-++maNoteExportListItr;
 
-if( pShapes )
-pShapes-UpdateAddress( aAddress );
-if( pNoteShapes )
-pNoteShapes-UpdateAddress( aAddress );
-if( pEmptyDatabaseRanges )
-pEmptyDatabaseRanges-UpdateAddress( aAddress );
-if( pMergedRanges )
-pMergedRanges-UpdateAddress( aAddress );
-if( pAreaLinks )
-pAreaLinks-UpdateAddress( aAddress );
-if( pDetectiveObj )
-pDetectiveObj-UpdateAddress( aAddress );
-if( pDetectiveOp )
-pDetectiveOp-UpdateAddress( aAddress );
-}
+if( pShapes )
+pShapes-UpdateAddress( aAddress );
+if( pNoteShapes )
+pNoteShapes-UpdateAddress( aAddress );
+if( pEmptyDatabaseRanges )
+pEmptyDatabaseRanges-UpdateAddress( aAddress );
+if( pMergedRanges )
+pMergedRanges-UpdateAddress( aAddress );
+if( pAreaLinks )
+pAreaLinks-UpdateAddress( aAddress );
+if( pDetectiveObj )
+pDetectiveObj-UpdateAddress( aAddress );
+if( pDetectiveOp )
+pDetectiveOp-UpdateAddress( aAddress );
 
 bool bFoundCell((aAddress.Column = MAXCOL)  (aAddress.Row = MAXROW));
 if( bFoundCell )
diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index b599e6e..3882e2f 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2531,13 +2531,16 @@ void ScXMLExport::CollectInternalShape( uno::Reference 
drawing::XShape  xShape
 // collect note caption objects from all layers (internal or 
hidden)
 if( ScDrawObjData* pCaptData = ScDrawLayer::GetNoteCaptionData( 
pObject, static_cast SCTAB ( nCurrentTable ) ) )
 {
-pSharedData-AddNoteObj( xShape, pCaptData-maStart );
+
if(pDoc-GetNotes(nCurrentTable)-findByAddress(pCaptData-maStart))
+{
+pSharedData-AddNoteObj( xShape, pCaptData-maStart );
 
-// #i60851# When the file is saved while editing a new note,
-// the cell is still empty - last column/row must be updated
-OSL_ENSURE( pCaptData-maStart.Tab() == nCurrentTable, 
invalid table in object data );
-pSharedData-SetLastColumn( nCurrentTable, 
pCaptData-maStart.Col() );
-pSharedData-SetLastRow( nCurrentTable, 
pCaptData-maStart.Row() );
+// #i60851# When the file is saved while editing a new 
note,
+// the cell is still empty - last column/row must be 
updated
+OSL_ENSURE( pCaptData-maStart.Tab() == nCurrentTable, 
invalid table in object data );
+pSharedData-SetLastColumn( nCurrentTable, 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-11 Thread Markus Mohrhard
 sc/source/filter/oox/worksheethelper.cxx |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 146352a3dcb65c99ec1b1b83f7be04231a32b21d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sat Mar 9 14:21:16 2013 +0100

use direct calls to set row height, fdo#61721

Change-Id: I3c19e00b8ad2bc649b8e499cc869e3a4c488c343
(cherry picked from commit e1c281c6c1a2bd55d99e1af2023444c960cf02a3)
Reviewed-on: https://gerrit.libreoffice.org/2615
Tested-by: Fridrich Strba fridr...@documentfoundation.org
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index 4d29ad3..f736393 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1216,20 +1216,23 @@ void WorksheetGlobals::convertRows( OutlineLevelVec 
orRowLevels,
 // row height: convert points to row height in 1/100 mm
 double fHeight = (rModel.mfHeight = 0.0) ? rModel.mfHeight : fDefHeight;
 sal_Int32 nHeight = getUnitConverter().scaleToMm100( fHeight, UNIT_POINT );
+SCROW nStartRow = rRowRange.mnFirst;
+SCROW nEndRow = rRowRange.mnLast;
+SCTAB nTab = getSheetIndex();
 if( nHeight  0 )
 {
 /* always import the row height, ensures better layout */
-PropertySet aPropSet( getRows( rRowRange ) );
-aPropSet.setProperty( PROP_Height, nHeight );
+ScDocument rDoc = getScDocument();
+rDoc.SetRowHeightOnly( nStartRow, nEndRow, nTab, 
(sal_uInt16)sc::HMMToTwips(nHeight) );
+if(rModel.mbCustomHeight)
+rDoc.SetManualHeight( nStartRow, nEndRow, nTab, true );
 }
 
 // hidden rows: TODO: #108683# hide rows later?
 if( rModel.mbHidden )
 {
-PropertySet aPropSet( getRows( rRowRange ) );
-// #i116460# Use VisibleFlag instead of IsVisible: directly set the 
flag,
-// without drawing layer update etc. (only possible before shapes are 
inserted)
-aPropSet.setProperty( PROP_VisibleFlag, false );
+ScDocument rDoc = getScDocument();
+rDoc.SetRowHidden( nStartRow, nEndRow, nTab, true );
 }
 
 // outline settings for this row range
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-11 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a7eb431731761e72a343c29276cfbbea0e6f01ec
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Feb 19 20:11:28 2013 +0100

respect nDelFlags, fdo#57661

Change-Id: I77d3e1f537b59504125d66f66f691d01f8f23894
(cherry picked from commit 41095e934bcd83e08a472c8fb53743cd3f8e926c)
Reviewed-on: https://gerrit.libreoffice.org/2616
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 936e597..47cd340 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -567,7 +567,7 @@ void ScTable::DeleteSelection( sal_uInt16 nDelFlag, const 
ScMarkData rMark )
 if (nDelFlag  IDF_NOTE  pRange)
 maNotes.erase(pRange-aStart.Col(), pRange-aStart.Row(), 
pRange-aEnd.Col(), pRange-aEnd.Row(), true);
 
-if(pRange  pRange-aStart.Tab() == nTab)
+if((nDelFlag  IDF_ATTRIB)  pRange  pRange-aStart.Tab() == nTab)
 mpCondFormatList-DeleteArea( pRange-aStart.Col(), 
pRange-aStart.Row(), pRange-aEnd.Col(), pRange-aEnd.Row() );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-11 Thread Jian Fang Zhang
 sc/source/ui/view/gridwin.cxx  |   13 +
 sc/source/ui/view/gridwin2.cxx |2 ++
 sc/source/ui/view/gridwin4.cxx |   12 ++--
 3 files changed, 25 insertions(+), 2 deletions(-)

New commits:
commit 9b6797ec124921a60e5d1d654139e0b82818a7c3
Author: Jian Fang Zhang zhan...@apache.org
Date:   Thu Jun 21 07:19:34 2012 +

Resolves: #i120017, filter button is not shown in merged cell

Patch by: zhao shao zhi, aoo.zhaos...@gmail.com
Found by: Yan Ji,yanji...@gmail.com
Review by: zhangjf
(cherry picked from commit bcf01fd794ec169aaf2a3f8b86f986ec60e5beb8)

Signed-off-by: Fridrich Å trba fridrich.st...@bluewin.ch

Conflicts:
sc/source/ui/view/gridwin.cxx

Change-Id: Ie8a529c697979cf75c303bddcaddd2776f5b8047
(cherry picked from commit aaab3a79dfd762a64fa4c1d19dd29ae46c0b9dd0)
Reviewed-on: https://gerrit.libreoffice.org/2674
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index a7033fe..5d85831 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -927,6 +927,8 @@ void ScGridWindow::DoScenarioMenue( const ScRange 
rScenRange )
 long nSizeY  = 0;
 long nHeight = 0;
 pViewData-GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
+// The button height should not use the merged cell height, should still 
use single row height
+nSizeY = pViewData-ToPixel(pDoc-GetRowHeight(nRow, nTab), 
pViewData-GetPPTY());
 Point aPos = pViewData-GetScrPos( nCol, nRow, eWhich );
 if ( bLayoutRTL )
 aPos.X() -= nSizeX;
@@ -1813,8 +1815,19 @@ void ScGridWindow::HandleMouseButtonDown( const 
MouseEvent rMEvt, MouseEventSta
 
 if ( !bDouble  !bFormulaMode  rMEvt.IsLeft() )
 {
+SCsCOL nRealPosX;
+SCsROW nRealPosY;
+pViewData-GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nRealPosX, 
nRealPosY, false );//the real row/col
+ScMergeFlagAttr* pRealPosAttr = (ScMergeFlagAttr*)
+pDoc-GetAttr( nRealPosX, nRealPosY, nTab, 
ATTR_MERGE_FLAG );
 ScMergeFlagAttr* pAttr = (ScMergeFlagAttr*)
 pDoc-GetAttr( nPosX, nPosY, nTab, 
ATTR_MERGE_FLAG );
+if( pRealPosAttr-HasAutoFilter() )
+{
+SC_MOD()-InputEnterHandler();
+if (DoAutoFilterButton( nRealPosX, nRealPosY, rMEvt))
+return;
+}
 if (pAttr-HasAutoFilter())
 {
 if (DoAutoFilterButton(nPosX, nPosY, rMEvt))
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 3ec36a2..406e64f 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -125,6 +125,8 @@ bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW 
nRow, const MouseEvent
 
 long nSizeX, nSizeY;
 pViewData-GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
+// The button height should not use the merged cell height, should still 
use single row height
+nSizeY = pViewData-ToPixel(pDoc-GetRowHeight(nRow, nTab), 
pViewData-GetPPTY());
 Size aScrSize(nSizeX-1, nSizeY-1);
 
 // Check if the mouse cursor is clicking on the popup arrow box.
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 64e4bbc..7c060f7 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1145,7 +1145,9 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCCOL nX2, 
ScTableInfo rTabInfo, Out
 for (nCol=nX1; nCol=nX2; nCol++)
 {
 CellInfo* pInfo = pThisRowInfo-pCellInfo[nCol+1];
-if ( pInfo-bAutoFilter  !pInfo-bHOverlapped  
!pInfo-bVOverlapped )
+//if several columns merged on a row, there should be only one 
auto button at the end of the columns.
+//if several rows merged on a column, the button may be in the 
middle, so !pInfo-bVOverlapped should not be used
+if ( pInfo-bAutoFilter  !pInfo-bHOverlapped )
 {
 if (!pQueryParam)
 pQueryParam = new ScQueryParam;
@@ -1198,7 +1200,13 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCCOL nX2, 
ScTableInfo rTabInfo, Out
 bool bArrowState = bSimpleQuery  bColumnFound;
 longnSizeX;
 longnSizeY;
-pViewData-GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
+SCCOL nStartCol= nCol;
+SCROW nStartRow = nRow;
+//if address(nCol,nRow) is not the start pos of the merge 
area, the value of the nSizeX will be incorrect, it will be the length of the 
cell.
+//should first get the start pos of the merge area, then 
get the nSizeX through the start pos.
+

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-08 Thread Caolán McNamara
 sc/source/ui/dbgui/validate.cxx|   10 +-
 sc/source/ui/inc/anyrefdg.hxx  |1 +
 sc/source/ui/inc/validate.hxx  |1 -
 sc/source/ui/miscdlgs/anyrefdg.cxx |   10 ++
 4 files changed, 12 insertions(+), 10 deletions(-)

New commits:
commit 709616cdb1ae8458249384b4c0718bbe5c0cf976
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Mar 8 15:00:56 2013 +

Resolves: fdo#58630 refEdit button shrink mangles dialog

RefInputStartPreHdl changes widget parents, they
should be changed back in RefInputStartPreHdl not
RefInputDonePreHdl because the widget hiding code
in ScFormulaReferenceHelper::RefInputDone also
tweaks parentage

We also need to change the MinOutputSizePixel
if it was set on a dialog, otherwise we can't shrink
below that value

Change-Id: I9e28674d13979e3ed399be1dba6830450078b114
Reviewed-on: https://gerrit.libreoffice.org/2602
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index ecce534..0647f14 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -122,9 +122,8 @@ voidScTPValidationValue::RefInputStartPreHdl( 
formula::RefEdit* pEdi
 }
 }
 
-voidScTPValidationValue::RefInputDonePreHdl()
+voidScTPValidationValue::RefInputDonePostHdl()
 {
-
 if( m_pRefEdit  m_pRefEdit-GetParent()!= this )
 {
 if( Window *pPreWnd = 
m_pRefEdit==maEdMax?maFtMax:(m_pRefEdit==maEdMin?maFtMin:NULL) )
@@ -139,11 +138,6 @@ voidScTPValidationValue::RefInputDonePreHdl()
 }
 
 if( m_btnRef.GetParent()!=this ) m_btnRef.SetParent( this );
-}
-
-voidScTPValidationValue::RefInputDonePostHdl()
-{
-
 
 if( m_pRefEdit  !m_pRefEdit-HasFocus() )
 m_pRefEdit-GrabFocus();
@@ -488,7 +482,6 @@ void ScTPValidationValue::SetupRefDlg()
 pValidationDlg-SetSetRefHdl( 
(ScRefHandlerHelper::PFUNCSETREFHDLTYPE)( ScTPValidationValue::SetReferenceHdl 
) );
 pValidationDlg-SetSetActHdl( 
(ScRefHandlerHelper::PCOMMONHDLTYPE)( ScTPValidationValue::SetActiveHdl ) );
 pValidationDlg-SetRefInputStartPreHdl( 
(ScRefHandlerHelper::PINPUTSTARTDLTYPE)( 
ScTPValidationValue::RefInputStartPreHdl ) );
-pValidationDlg-SetRefInputDonePreHdl( 
(ScRefHandlerHelper::PCOMMONHDLTYPE)( ScTPValidationValue::RefInputDonePreHdl 
) );
 pValidationDlg-SetRefInputDonePostHdl( 
(ScRefHandlerHelper::PCOMMONHDLTYPE)( ScTPValidationValue::RefInputDonePostHdl 
) );
 
 if ( maEdMax.IsVisible() ) { m_pRefEdit = maEdMax; }
@@ -510,7 +503,6 @@ void ScTPValidationValue::RemoveRefDlg()
 pValidationDlg-SetSetRefHdl( NULL );
 pValidationDlg-SetSetActHdl( NULL );
 pValidationDlg-SetRefInputStartPreHdl( NULL );
-pValidationDlg-SetRefInputDonePreHdl( NULL );
 pValidationDlg-SetRefInputDonePostHdl( NULL );
 
 if( m_pRefEdit ) m_pRefEdit-SetRefDialog( NULL );
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 2040767..6c4c356 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -62,6 +62,7 @@ class ScFormulaReferenceHelper
 SizeaOldEditSize;   // Original size of the input 
field
 Point   aOldButtonPos;  // Original position of the 
button
 Window* mpOldEditParent;// Original parent of the edit 
field and the button
+SizeaOldMinDialogSize;  // Original value of dialog 
MinSize
 
 boolbEnableColorRef;
 boolbHighLightRef;
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 726681e..9478357 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -225,7 +225,6 @@ private:
 voidSetReferenceHdl( const ScRange , ScDocument* );
 voidSetActiveHdl();
 voidRefInputStartPreHdl( formula::RefEdit* pEdit, 
formula::RefButton* pButton );
-voidRefInputDonePreHdl();
 voidRefInputDonePostHdl();
 ScValidationDlg * GetValidationDlg();
 
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx 
b/sc/source/ui/miscdlgs/anyrefdg.cxx
index fdffac4..5e2d9c6 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -365,6 +365,11 @@ void ScFormulaReferenceHelper::RefInputDone( bool bForced )
 
 // Fenster wieder gross
 m_pWindow-SetOutputSizePixel(aOldDialogSize);
+if (aOldMinDialogSize.Height())
+{
+SystemWindow* pSysWin = dynamic_castSystemWindow*(m_pWindow);
+pSysWin-SetMinOutputSizePixel(aOldMinDialogSize);
+}
 
 // pEditCell an alte Position
 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-07 Thread Kohei Yoshida
 sc/source/core/data/dpcache.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit a7223551f8d3c6d08fcfe951ac21ec8dc8ee00af
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Mar 7 11:57:11 2013 -0500

fdo#54651: Only pick non-default number format for pivot field.

Change-Id: Ia88282803c8df8389ed24efd8b1ca7600a39bf23
(cherry picked from commit dd1b3ca024a85597b46778a62007bb966174368d)
Reviewed-on: https://gerrit.libreoffice.org/2585
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 5f075a3..018d1a2 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -357,7 +357,9 @@ bool ScDPCache::InitFromDoc(ScDocument* pDoc, const 
ScRange rRange)
 if (!aData.IsEmpty())
 {
 maEmptyRows.insert_back(i, i+1, false);
-rField.mnNumFormat = nNumFormat;
+if (nNumFormat)
+// Only take non-default number format.
+rField.mnNumFormat = nNumFormat;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-06 Thread Eike Rathke
 sc/source/ui/app/inputhdl.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 52aaf74783aee2866d9768a917007688bc68bc1f
Author: Eike Rathke er...@redhat.com
Date:   Mon Mar 4 19:32:42 2013 +0100

resolved rhbz#916936 allow also input line for read-only

Allow activation of input line and cell activation in read-only
documents regardless whether it's part of an array or not.

Change-Id: Id2dc9de9e60b58f4b471fb232e899c9ea75e83f1
(cherry picked from commit 9c5164654184631b00dc6ad2e30cb1c07950)
Reviewed-on: https://gerrit.libreoffice.org/2546
Reviewed-by: Muthu Subramanian K muthus...@gmail.com
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 6938e0d..11cca6d 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1950,10 +1950,12 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, 
bool bFromCommand, bool bIn
 if (!aTester.IsEditable())
 {
 bProtected = true;
-// We allow read-only input mode activation when explicit cell
-// activation is requested (double-click or F2) and if it's not
-// part of an array.
-bool bShowError = !bInputActivated || aTester.GetMessageId() != 
STR_PROTECTIONERR;
+// We allow read-only input mode activation regardless
+// whether it's part of an array or not or whether explicit cell
+// activation is requested (double-click or F2) or a click in input
+// line.
+bool bShowError = (!bInputActivated || aTester.GetMessageId() != 
STR_PROTECTIONERR) 
+!pActiveViewSh-GetViewData()-GetDocShell()-IsReadOnly();
 if (bShowError)
 {
 eMode = SC_INPUT_NONE;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-03-06 Thread Markus Mohrhard
 sc/source/ui/unoobj/chart2uno.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 529172124be1bfcb55fca1e7be3317efa3ba0cfe
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 5 13:43:12 2013 +0100

make all chart ranges explicitly 3D refs during import/export, fdo#61781

Change-Id: I66657ce38456e4a8dc3a602997c451cf1cdd983b
(cherry picked from commit a26217815d4e69ec2485c370dfef0fbb41d6c8ab)
Reviewed-on: https://gerrit.libreoffice.org/2561
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index e877469..60b19c9 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -963,7 +963,8 @@ private:
 setRelative(aData.Ref1);
 setRelative(aData.Ref2);
 
-// In XML, the end range must explicitly specify sheet name.
+// In XML, the range must explicitly specify sheet name.
+aData.Ref1.SetFlag3D(true);
 aData.Ref2.SetFlag3D(true);
 
 if (bExternal)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-02-27 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 4e1f23982432ad211f1b4c4fd134f022844325d3
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Feb 27 01:55:24 2013 +0100

remove the copied cond format cell attr entries, fdo#60306

The old exisiting conditional format entries in the ScAttrArray will not
be overwritten in 4.0 so that we might have gotten a wrong conditional
format before our existing conditional format.

Change-Id: Ib619f6a1b335e9bbdffc8b518fe41b729775d24c
Reviewed-on: https://gerrit.libreoffice.org/2435
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 1127f52..936e597 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -739,6 +739,17 @@ void ScTable::CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2,
 for ( SCCOL i = nCol1; i = nCol2; i++)
 aCol[i].CopyFromClip(nRow1, nRow2, nDy, nInsFlag, bAsLink, 
bSkipAttrForEmpty, pTable-aCol[i - nDx]);
 
+
+if(nInsFlag != IDF_OBJECTS)
+{
+// make sure that there are no old references to the cond formats
+sal_uInt16 nWhichArray[2];
+nWhichArray[0] = ATTR_CONDITIONAL;
+nWhichArray[1] = 0;
+for ( SCCOL i = nCol1; i = nCol2; ++i)
+aCol[i].ClearItems(nRow1, nRow2, nWhichArray);
+}
+
 //remove old notes
 if (nInsFlag  (IDF_NOTE|IDF_ADDNOTES))
 maNotes.erase(nCol1, nRow1, nCol2, nRow2);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-02-25 Thread Markus Mohrhard
 sc/source/filter/inc/worksheethelper.hxx  |2 ++
 sc/source/filter/oox/workbookfragment.cxx |   13 +
 sc/source/filter/oox/worksheethelper.cxx  |   14 --
 3 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit 0c58a1425233d76812f32c3e9e2a5910e7b88f0e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Feb 21 02:23:13 2013 +0100

delay importing all drawing elements until content is loaded, fdo#60488

Otherwise charts with data ranges on other sheets will not be painted
correctly as the data is missing when the chart is rendered for the
first time. This was not a problem before the cached value import
because the hard recalc would have forced a repaint anyway.

The new way should also be a bit quicker.

Change-Id: I6a010a4dffad6ebe2264b8312f93b16d9c87
Reviewed-on: https://gerrit.libreoffice.org/2412
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/filter/inc/worksheethelper.hxx 
b/sc/source/filter/inc/worksheethelper.hxx
index 32db180..2efa6e4 100644
--- a/sc/source/filter/inc/worksheethelper.hxx
+++ b/sc/source/filter/inc/worksheethelper.hxx
@@ -303,6 +303,8 @@ public:
 voidinitializeWorksheetImport();
 /** Final conversion after importing the worksheet. */
 voidfinalizeWorksheetImport();
+/** Final import of drawing objects. Has to be called after all content 
has been imported */
+void finalizeDrawingImport();
 
 voidsetCellFormula( const 
::com::sun::star::table::CellAddress rTokenAddress, const rtl::OUString  );
 voidsetCellFormula( const 
::com::sun::star::table::CellAddress rTokenAddress, sal_Int32  );
diff --git a/sc/source/filter/oox/workbookfragment.cxx 
b/sc/source/filter/oox/workbookfragment.cxx
index ba0c2fd..41a6ce7 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -231,6 +231,7 @@ void WorkbookFragment::finalizeImport()
 typedef ::std::pair WorksheetGlobalsRef, FragmentHandlerRef  
SheetFragmentHandler;
 typedef ::std::vector SheetFragmentHandler  SheetFragmentVector;
 SheetFragmentVector aSheetFragments;
+std::vectorWorksheetHelper* maHelpers;
 WorksheetBuffer rWorksheets = getWorksheets();
 sal_Int32 nWorksheetCount = rWorksheets.getWorksheetCount();
 for( sal_Int32 nWorksheet = 0; nWorksheet  nWorksheetCount; ++nWorksheet )
@@ -286,7 +287,10 @@ void WorkbookFragment::finalizeImport()
 
 // insert the fragment into the map
 if( xFragment.is() )
+{
 aSheetFragments.push_back( SheetFragmentHandler( 
xSheetGlob, xFragment.get() ) );
+maHelpers.push_back(xFragment.get());
+}
 }
 }
 }
@@ -301,6 +305,15 @@ void WorkbookFragment::finalizeImport()
 {
 // import the sheet fragment
 importOoxFragment( aIt-second );
+}
+
+for( std::vectorWorksheetHelper*::iterator aIt = maHelpers.begin(), aEnd 
= maHelpers.end(); aIt != aEnd; ++aIt )
+{
+(*aIt)-finalizeDrawingImport();
+}
+
+for( SheetFragmentVector::iterator aIt = aSheetFragments.begin(), aEnd = 
aSheetFragments.end(); aIt != aEnd; ++aIt )
+{
 // delete fragment object and WorkbookGlobals object, will free all 
allocated sheet buffers
 aIt-second.clear();
 aIt-first.reset();
diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index fbb4dd2..4d29ad3 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -339,6 +339,8 @@ public:
 /** Final conversion after importing the worksheet. */
 voidfinalizeWorksheetImport();
 
+void finalizeDrawingImport();
+
 private:
 typedef ::std::vector sal_Int32   OutlineLevelVec;
 typedef ::std::pair ColumnModel, sal_Int32ColumnModelRange;
@@ -953,9 +955,12 @@ void WorksheetGlobals::finalizeWorksheetImport()
 lclUpdateProgressBar( mxFinalProgress, 0.5 );
 convertColumns();
 convertRows();
-lclUpdateProgressBar( mxFinalProgress, 0.75 );
-finalizeDrawings();
 lclUpdateProgressBar( mxFinalProgress, 1.0 );
+}
+
+void WorksheetGlobals::finalizeDrawingImport()
+{
+finalizeDrawings();
 
 // forget current sheet index in global data
 setCurrentSheetIndex( -1 );
@@ -1575,6 +1580,11 @@ void WorksheetHelper::finalizeWorksheetImport()
 mrSheetGlob.finalizeWorksheetImport();
 }
 
+void WorksheetHelper::finalizeDrawingImport()
+{
+mrSheetGlob.finalizeDrawingImport();
+}
+
 void WorksheetHelper::setCellFormula( const 
::com::sun::star::table::CellAddress rTokenAddress, const rtl::OUString 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-02-25 Thread Markus Mohrhard
 sc/source/core/data/colorscale.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0c771fda26a03b3928e7962265658affc9fb9eb1
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Feb 14 15:26:27 2013 +0100

use = as mentioned in the UI, fdo#60798

Change-Id: Iac6737e98eb0961de22036f42634ebad7d42dfcc
Reviewed-on: https://gerrit.libreoffice.org/2409
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/core/data/colorscale.cxx 
b/sc/source/core/data/colorscale.cxx
index 3fe033a..c8e4f3e 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -898,13 +898,13 @@ ScIconSetInfo* ScIconSetFormat::GetIconSetInfo(const 
ScAddress rAddr) const
 double nValMax = CalcValue(nMin, nMax, itr);
 
 ++itr;
-while(itr != end()  nVal  nValMax)
+while(itr != end()  nVal = nValMax)
 {
 ++nIndex;
 nValMax = CalcValue(nMin, nMax, itr);
 ++itr;
 }
-if(nVal  nValMax)
+if(nVal = nValMax)
 ++nIndex;
 
 pInfo-nIconIndex = nIndex;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-02-25 Thread Markus Mohrhard
 sc/source/ui/condformat/condformatdlgentry.cxx |   46 ++---
 1 file changed, 27 insertions(+), 19 deletions(-)

New commits:
commit 382bf0e42f1a9ad4109343a164341723da4f7ded
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Feb 19 19:18:35 2013 +0100

respect local number format in cond format dlg, fdo#60574

Change-Id: Iec185ac6c6447176731619249cdda4457f1bb8a3
Reviewed-on: https://gerrit.libreoffice.org/2411
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index f750ed5..7039781 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -582,7 +582,7 @@ void ScFormulaFrmtEntry::SetInactive()
 
 namespace {
 
-void SetColorScaleEntryTypes( const ScColorScaleEntry rEntry, ListBox 
rLbType, Edit rEdit, ColorListBox rLbCol )
+void SetColorScaleEntryTypes( const ScColorScaleEntry rEntry, ListBox 
rLbType, Edit rEdit, ColorListBox rLbCol, ScDocument* pDoc )
 {
 // entry Automatic is not available for color scales
 sal_Int32 nIndex = static_castsal_Int32(rEntry.GetType());
@@ -596,7 +596,13 @@ void SetColorScaleEntryTypes( const ScColorScaleEntry 
rEntry, ListBox rLbType,
 case COLORSCALE_PERCENTILE:
 case COLORSCALE_VALUE:
 case COLORSCALE_PERCENT:
-rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
+{
+double nVal = rEntry.GetValue();
+SvNumberFormatter* pNumberFormatter = pDoc-GetFormatTable();
+rtl::OUString aText;
+pNumberFormatter-GetInputLineString(nVal, 0, aText);
+rEdit.SetText(aText);
+}
 break;
 case COLORSCALE_FORMULA:
 
rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT));
@@ -672,9 +678,9 @@ ScColorScale2FrmtEntry::ScColorScale2FrmtEntry( Window* 
pParent, ScDocument* pDo
 if(pFormat)
 {
 ScColorScaleFormat::const_iterator itr = pFormat-begin();
-SetColorScaleEntryTypes(*itr, maLbEntryTypeMin, maEdMin, maLbColMin);
+SetColorScaleEntryTypes(*itr, maLbEntryTypeMin, maEdMin, maLbColMin, 
pDoc);
 ++itr;
-SetColorScaleEntryTypes(*itr, maLbEntryTypeMax, maEdMax, maLbColMax);
+SetColorScaleEntryTypes(*itr, maLbEntryTypeMax, maEdMax, maLbColMax, 
pDoc);
 }
 else
 {
@@ -825,12 +831,12 @@ ScColorScale3FrmtEntry::ScColorScale3FrmtEntry( Window* 
pParent, ScDocument* pDo
 if(pFormat)
 {
 ScColorScaleFormat::const_iterator itr = pFormat-begin();
-SetColorScaleEntryTypes(*itr, maLbEntryTypeMin, maEdMin, maLbColMin);
+SetColorScaleEntryTypes(*itr, maLbEntryTypeMin, maEdMin, maLbColMin, 
pDoc);
 assert(pFormat-size() == 3);
 ++itr;
-SetColorScaleEntryTypes(*itr, maLbEntryTypeMiddle, maEdMiddle, 
maLbColMiddle);
+SetColorScaleEntryTypes(*itr, maLbEntryTypeMiddle, maEdMiddle, 
maLbColMiddle, pDoc);
 ++itr;
-SetColorScaleEntryTypes(*itr, maLbEntryTypeMax, maEdMax, maLbColMax);
+SetColorScaleEntryTypes(*itr, maLbEntryTypeMax, maEdMax, maLbColMax, 
pDoc);
 }
 else
 {
@@ -1007,7 +1013,7 @@ IMPL_LINK_NOARG( ScConditionFrmtEntry, 
ConditionTypeSelectHdl )
 
 namespace {
 
-void SetDataBarEntryTypes( const ScColorScaleEntry rEntry, ListBox rLbType, 
Edit rEdit )
+void SetDataBarEntryTypes( const ScColorScaleEntry rEntry, ListBox rLbType, 
Edit rEdit, ScDocument* pDoc )
 {
 rLbType.SelectEntryPos(rEntry.GetType());
 switch(rEntry.GetType())
@@ -1016,18 +1022,20 @@ void SetDataBarEntryTypes( const ScColorScaleEntry 
rEntry, ListBox rLbType, Ed
 case COLORSCALE_MIN:
 case COLORSCALE_MAX:
 break;
-case COLORSCALE_PERCENTILE:
-rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
-break;
+case COLORSCALE_VALUE:
 case COLORSCALE_PERCENT:
-rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
+case COLORSCALE_PERCENTILE:
+{
+double nVal = rEntry.GetValue();
+SvNumberFormatter* pNumberFormatter = pDoc-GetFormatTable();
+rtl::OUString aText;
+pNumberFormatter-GetInputLineString(nVal, 0, aText);
+rEdit.SetText(aText);
+}
 break;
 case COLORSCALE_FORMULA:
 
rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT));
 break;
-case COLORSCALE_VALUE:
-rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue()));
-break;
 }
 }
 
@@ -1047,8 +1055,8 @@ ScDataBarFrmtEntry::ScDataBarFrmtEntry( Window* pParent, 
ScDocument* pDoc, const
 if(pFormat)
 {
 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-02-25 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 5b14af735a87ef5b38909f443465c123591c74fa
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Feb 19 18:57:18 2013 +0100

automatically extending cond formats is dangerous, fdo#60828

Change-Id: I45549e163f21550e879a171d80e836b6df3dd2cc
Reviewed-on: https://gerrit.libreoffice.org/2410
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 9631116..1127f52 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -389,9 +389,10 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, 
SCROW nEndRow, SCSIZE
 
 if (nStartCol0)// copy old attributes
 {
-sal_uInt16 nWhichArray[2];
+sal_uInt16 nWhichArray[3];
 nWhichArray[0] = ATTR_MERGE;
-nWhichArray[1] = 0;
+nWhichArray[1] = ATTR_CONDITIONAL;
+nWhichArray[2] = 0;
 
 for (SCSIZE i=0; inSize; i++)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-02-22 Thread Eike Rathke
 sc/source/ui/dbgui/scuiasciiopt.cxx |2 ++
 sc/source/ui/docshell/impex.cxx |   19 +++
 sc/source/ui/inc/impex.hxx  |2 ++
 3 files changed, 23 insertions(+)

New commits:
commit 4a2b187503de7425150528faab568e520bd2474f
Author: Eike Rathke er...@redhat.com
Date:   Fri Feb 22 00:27:26 2013 +0100

resolved fdo#57841 ignore embedded NULL characters in CSV import

Change-Id: Ib0eb044f009227c0aa6e1bc520905d605323c3db
(cherry picked from commit 8970e14d7494859c6079ef2a976416598823ba50)
Reviewed-on: https://gerrit.libreoffice.org/2336
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index d39c258..54d5e92 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -540,6 +540,8 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, 
rtl::OUString rText )
 if ( mpDatStream-GetError() == ERRCODE_IO_CANTSEEK )
 mpDatStream-ResetError();
 
+ScImportExport::EmbeddedNullTreatment( rText);
+
 return bRet;
 }
 
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 09ec1cd..9734f72 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1335,6 +1335,8 @@ bool ScImportExport::ExtText2Doc( SvStream rStrm )
 if ( rStrm.IsEof()  aLine.isEmpty() )
 break;
 
+EmbeddedNullTreatment( aLine);
+
 sal_Int32 nLineLen = aLine.getLength();
 SCCOL nCol = nStartCol;
 bool bMultiLine = false;
@@ -1478,6 +1480,23 @@ bool ScImportExport::ExtText2Doc( SvStream rStrm )
 }
 
 
+void ScImportExport::EmbeddedNullTreatment( OUString  rStr )
+{
+// A nasty workaround for data with embedded NULL characters. As long as we
+// can't handle them properly as cell content (things assume 0-terminated
+// strings at too many places) simply strip all NULL characters from raw
+// data. Excel does the same. See fdo#57841 for sample data.
+
+// The normal case is no embedded NULL, check first before de-/allocating
+// ustring stuff.
+sal_Unicode cNull = 0;
+if (rStr.indexOf( cNull) = 0)
+{
+rStr = rStr.replaceAll( OUString( cNull, 1), OUString());
+}
+}
+
+
 const sal_Unicode* ScImportExport::ScanNextFieldFromString( const sal_Unicode* 
p,
 String rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool 
bMergeSeps, bool rbIsQuoted,
 bool rbOverflowCell )
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index c427206..8c7e36b 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -102,6 +102,8 @@ public:
 bool IsUndo() const  { return bUndo; }
 void SetUndo( bool b )   { bUndo = b;}
 
+SC_DLLPUBLIC static void EmbeddedNullTreatment( OUString  rStr );
+
 static bool  IsFormatSupported( sal_uLong nFormat );
 static const sal_Unicode* ScanNextFieldFromString( const sal_Unicode* p,
 String rField, sal_Unicode cStr, const sal_Unicode* pSeps,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-02-14 Thread Kohei Yoshida
 sc/source/filter/xml/xmlcelli.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 5778fea1fd3d5018cde65ee4a4d19e63820c2b0e
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Feb 12 23:22:25 2013 -0500

bnc#802350: Cell validation is not a special (cell) content.

Cell validation is stored as cell attributes which are stored with
columns not with cells.  When HasSpecialContent() is true, it flags
the *cell* not empty, which in turns causes AddTextAndValueCell to
iterate over every single cell position for all repeated columns
and rows.  That can very very slow when the number of repeated rows
is very high.

Since cell validation is stored with columns, skipping empty cells
even when they have cell validation settings set won't cause any
issues, and all cell validation settings are imported correctly even
after this change.

With the test document I have (confidential), this change alone reduces
the load time from 30 seconds to 0.3 seconds.

(cherry picked from commit f6acfb5fe41fb166b5b588ec73e2e9331489c632)

Conflicts:
sc/source/filter/xml/xmlcelli.cxx

Change-Id: I84fa4cec50172ccd02eca1042c8fafb93d1cfc73
Reviewed-on: https://gerrit.libreoffice.org/2128
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index 42714a1..e9776ec 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -956,8 +956,7 @@ void ScXMLTableRowCellContext::AddTextAndValueCells( const 
ScAddress rCellPos,
 
 bool ScXMLTableRowCellContext::HasSpecialContent() const
 {
-return ( (pContentValidationName  !pContentValidationName-isEmpty()) ||
-  mxAnnotationData.get() || pDetectiveObjVec || pCellRangeSource );
+return (mxAnnotationData.get() || pDetectiveObjVec || pCellRangeSource);
 }
 
 bool ScXMLTableRowCellContext::CellsAreRepeated() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-02-07 Thread Julien Nabet
 sc/source/core/data/column.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 9fe8668203eae2f66c837b266847d639a5dac42c
Author: Julien Nabet serval2...@yahoo.fr
Date:   Thu Feb 7 22:22:12 2013 +0100

Resolves: fdo#60420 Copy chart leads to crash

Thank you Kohei for the better patch you proposed to me

Change-Id: I145aaf6fd139a29373c41cc2ea81dadc9160f0fe
(cherry picked from commit 7e2f34a3172a756a0fd70cae1294250206945a6e)

Signed-off-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 5fb98a2..ac4850e 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1258,8 +1258,11 @@ void ScColumn::CopyStaticToDocument(SCROW nRow1, SCROW 
nRow2, ScColumn rDestCol
 
 // Determine the range of cells in the original column that need to be 
copied.
 it = std::find_if(maItems.begin(), maItems.end(), FindInRows(nRow1, 
nRow2));
-if (it != maItems.end())
-itEnd = std::find_if(it, maItems.end(), FindAboveRow(nRow2));
+if (it == maItems.end())
+// Nothing to copy.
+return;
+
+itEnd = std::find_if(it, maItems.end(), FindAboveRow(nRow2));
 
 // Clone and staticize all cells that need to be copied.
 std::vectorColEntry aCopied;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-02-06 Thread Kohei Yoshida
 sc/source/core/tool/reffind.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 232b93e7f0e0ca90b54fe96d2c1adc5766d6706c
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Feb 5 15:23:44 2013 -0500

fdo#39135: Prevent integer overflow  update the character during loop.

These two errors in the code contributed to the reported bug.  Let's
fix them.

Change-Id: If82a1bd4d1e27145b48e722b30388cc9dc4a8a6e
Reviewed-on: https://gerrit.libreoffice.org/2007
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sc/source/core/tool/reffind.cxx b/sc/source/core/tool/reffind.cxx
index 2fe76fc..c4621f0 100644
--- a/sc/source/core/tool/reffind.cxx
+++ b/sc/source/core/tool/reffind.cxx
@@ -155,15 +155,20 @@ void ExpandToTextR1C1(const sal_Unicode* p, xub_StrLen 
nLen, xub_StrLen rStartP
 if (c == '\'')
 break;
 }
+if (rStartPos == 0)
+break;
 }
 else if (c == ']')
 {
 // Skip until the opening braket.
 for (--rStartPos; rStartPos  0; --rStartPos)
 {
+c = p[rStartPos];
 if (c == '[')
 break;
 }
+if (rStartPos == 0)
+break;
 }
 else if (!IsText(c))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

2013-02-06 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit e577ebc9403d77fe4847a2e1d55a83d432f214f8
Author: Eike Rathke er...@redhat.com
Date:   Wed Feb 6 18:14:52 2013 +0100

resolved fdo#60366 make MATCH() accept a single cell reference

Change-Id: I7059abdb6232b95e0b940b34f74bf87182510146
(cherry picked from commit c0fdab890086c2cb749c348db42eb760e31539de)
Reviewed-on: https://gerrit.libreoffice.org/2018
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Reviewed-by: Kohei Yoshida kohei.yosh...@gmail.com
Tested-by: Kohei Yoshida kohei.yosh...@gmail.com

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 0ef12c7..1553a9b 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4947,6 +4947,12 @@ void ScInterpreter::ScMatch()
 
 switch (GetStackType())
 {
+case svSingleRef:
+PopSingleRef( nCol1, nRow1, nTab1);
+nCol2 = nCol1;
+nRow2 = nRow1;
+nTab2 = nTab1;
+break;
 case svDoubleRef:
 {
 PopDoubleRef(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits