[Libreoffice-commits] .: Branch 'feature/calc-matrix-rework' - 37 commits - chart2/source .gitignore sc/inc sc/qa sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Mon Dec 20 12:31:40 PST 2010
.gitignore | 10
chart2/source/controller/dialogs/ChartTypeDialogController.cxx | 6
chart2/source/tools/ChartDebugTrace.cxx | 337 ----------
sc/inc/charthelper.hxx | 1
sc/inc/compiler.hxx | 1
sc/inc/compressedarray.hxx | 5
sc/inc/document.hxx | 2
sc/inc/dpcachetable.hxx | 6
sc/inc/dpglobal.hxx | 9
sc/inc/dpobject.hxx | 4
sc/inc/dptabres.hxx | 1
sc/inc/dptabsrc.hxx | 1
sc/qa/unit/makefile.mk | 2
sc/qa/unit/ucalc.cxx | 40 -
sc/source/core/data/compressedarray.cxx | 29
sc/source/core/data/documen3.cxx | 14
sc/source/core/data/document.cxx | 12
sc/source/core/data/dpcachetable.cxx | 11
sc/source/core/data/dpglobal.cxx | 46 -
sc/source/core/data/dpobject.cxx | 20
sc/source/core/data/dptabres.cxx | 21
sc/source/core/data/dptabsrc.cxx | 16
sc/source/core/tool/charthelper.cxx | 7
sc/source/core/tool/compiler.cxx | 43 -
sc/source/core/tool/scmatrix.cxx | 1
sc/source/filter/excel/exctools.cxx | 13
sc/source/filter/inc/otlnbuff.hxx | 1
sc/source/ui/attrdlg/scdlgfact.cxx | 7
sc/source/ui/docshell/dbdocimp.cxx | 2
sc/source/ui/docshell/docfunc.cxx | 4
sc/source/ui/docshell/docsh2.cxx | 2
sc/source/ui/docshell/docsh3.cxx | 4
sc/source/ui/inc/cellmergeoption.hxx | 46 -
sc/source/ui/inc/datafdlg.hrc | 2
sc/source/ui/inc/gridwin.hxx | 1
sc/source/ui/inc/tabview.hxx | 4
sc/source/ui/miscdlgs/datafdlg.cxx | 18
sc/source/ui/src/datafdlg.src | 4
sc/source/ui/vba/vbachartobject.cxx | 2
sc/source/ui/vba/vbachartobject.hxx | 2
sc/source/ui/view/cellmergeoption.cxx | 58 +
sc/source/ui/view/gridwin2.cxx | 16
sc/source/ui/view/gridwin4.cxx | 102 +--
sc/source/ui/view/tabview.cxx | 14
sc/source/ui/view/tabview2.cxx | 162 ++++
sc/source/ui/view/tabview3.cxx | 91 --
sc/source/ui/view/viewfun6.cxx | 9
47 files changed, 416 insertions(+), 793 deletions(-)
New commits:
commit be6a1d0c5bc0b744881fad61c0cb7cc06a2b3abc
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Dec 20 15:31:19 2010 -0500
Fixed build breakage.
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index f3ea2a3..c3fc8d0 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -847,7 +847,6 @@ class MultiplyElements : public unary_function<void, MatrixImplType::element>
bool mbTextAsZero;
public:
MultiplyElements(bool bTextAsZero) : maRes(0.0, 1.0, 0), mbTextAsZero(bTextAsZero) {}
- MultiplyElements(const MultiplyElement& r) : maRes(r.maRes), mbTextAsZero(r.mbTextAsZero) {}
ScMatrix::IterateResult getResult() const { return maRes; }
void operator() (const MatrixImplType::element& elem)
commit 705c59eec3ba4351759e6d74feaeaad34428b088
Merge: 16fdac1... 6f94488...
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Dec 20 15:21:14 2010 -0500
Merge branch 'master' into feature/calc-matrix-rework
diff --cc sc/qa/unit/ucalc.cxx
index 77e8d5f,92a7c70..ba0b787
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@@ -54,16 -62,7 +62,8 @@@
#include <scdll.hxx>
#include <document.hxx>
#include <stringutil.hxx>
+#include <scmatrix.hxx>
- #include "preextstl.h"
- #include <cppunit/TestSuite.h>
- #include <cppunit/TestFixture.h>
- #include <cppunit/TestCase.h>
- #include <cppunit/plugin/TestPlugIn.h>
- #include <cppunit/extensions/HelperMacros.h>
- #include "postextstl.h"
-
using namespace ::com::sun::star;
namespace {
commit 6f944884513d4203689e075168f9fe725b41f6e8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 20 14:57:52 2010 +0000
update gitignore
diff --git a/.gitignore b/.gitignore
index 388957f..00fb3e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,9 +2,6 @@
/Linux*Env.Set*
/bootstrap
/makefile.mk
-unxlng*.pro
-unxlngi6
-unxlngi4
/solver
*.orig
*.rej
@@ -23,5 +20,10 @@ warn
CVS
.hg
.hgignore
-/*/unxmac??
+# the build directories
+/*/unxlng??
+/*/unxlng??.pro
+/*/wntmsci??
+/*/wntmsci??.pro
/*/unxmac??.pro
+/*/unxmac??
commit 2408746de4279186f574a2b54ed2aad19b5c9386
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 20 13:54:09 2010 +0000
WaE: unused variable
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 9ba95e0..d33a16a 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -975,7 +975,6 @@ void ScTabView::MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
nCurY = (nMovY != 0) ? nOldY+nMovY : (SCsROW) aViewData.GetOldCurY();
}
- BOOL bSkipCell = FALSE;
aViewData.ResetOldCursor();
if (nMovX != 0 && VALIDCOLROW(nCurX,nCurY))
commit d04e718122a6c8ef557b60581a2544b2594677cb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 20 13:42:20 2010 +0000
cppunit: make sure to regenerate .rdb if makefile changes
diff --git a/sc/qa/unit/makefile.mk b/sc/qa/unit/makefile.mk
index db22e52..09a32cb 100644
--- a/sc/qa/unit/makefile.mk
+++ b/sc/qa/unit/makefile.mk
@@ -98,7 +98,7 @@ $(MISC)/$(TARGET)/udkapi.rdb .ERRREMOVE : $(SOLARBINDIR)$/udkapi.rdb
$(GNUCOPY) $? $@
#Make a services.rdb with the services we know we need to get up and running
-$(MISC)/$(TARGET)/services.rdb .ERRREMOVE : $(MISC)/$(TARGET)/udkapi.rdb
+$(MISC)/$(TARGET)/services.rdb .ERRREMOVE : $(MISC)/$(TARGET)/udkapi.rdb makefile.mk
$(MKDIRHIER) $(@:d)
$(REGCOMP) -register -br $(MISC)/$(TARGET)/udkapi.rdb -r $@ -wop \
-c $(DLLPRE)fwk$(DLLPOSTFIX)$(DLLPOST)
commit ad40841bd6c32732f86c403a51fd8b2dbb0b3798
Merge: 3f7bde1... f67ffb5...
Author: Jan Holesovsky <kendy at suse.cz>
Date: Mon Dec 20 13:12:56 2010 +0100
Merge branch 'master' of ssh://git.freedesktop.org/git/libreoffice/calc
commit f67ffb5fc43b99e64ccc9bd31c6c92dbe5a87ea6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 20 12:00:56 2010 +0000
cppcheck: reorganize this a little
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index a358409..92a7c70 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -38,14 +38,22 @@
// the need for manually calling regcomp and knowing what
// services we need, and in what .so they are implemented
+#include "precompiled_sc.hxx"
+
#ifdef WNT
# include <tools/prewin.h>
# include <windows.h>
# include <tools/postwin.h>
-# undef ERROR
#endif
-#include "sal/config.h"
+#include "preextstl.h"
+#include <cppunit/TestAssert.h>
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/plugin/TestPlugIn.h>
+#include "postextstl.h"
+
+#include <sal/config.h>
#include <cppuhelper/bootstrap.hxx>
#include <comphelper/processfactory.hxx>
@@ -55,20 +63,15 @@
#include <document.hxx>
#include <stringutil.hxx>
-#include "preextstl.h"
-#include <cppunit/TestSuite.h>
-#include <cppunit/TestFixture.h>
-#include <cppunit/TestCase.h>
-#include <cppunit/plugin/TestPlugIn.h>
-#include <cppunit/extensions/HelperMacros.h>
-#include "postextstl.h"
-
using namespace ::com::sun::star;
namespace {
class Test : public CppUnit::TestFixture {
public:
+ Test();
+ ~Test();
+
virtual void setUp();
virtual void tearDown();
@@ -83,15 +86,15 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- uno::Reference< uno::XComponentContext > m_context;
+ uno::Reference< uno::XComponentContext > m_xContext;
ScDocument *m_pDoc;
};
-void Test::setUp()
+Test::Test()
{
- m_context = cppu::defaultBootstrap_InitialComponentContext();
+ m_xContext = cppu::defaultBootstrap_InitialComponentContext();
- uno::Reference<lang::XMultiComponentFactory> xFactory(m_context->getServiceManager());
+ uno::Reference<lang::XMultiComponentFactory> xFactory(m_xContext->getServiceManager());
uno::Reference<lang::XMultiServiceFactory> xSM(xFactory, uno::UNO_QUERY_THROW);
//Without this we're crashing because callees are using
@@ -102,14 +105,21 @@ void Test::setUp()
InitVCL(xSM);
ScDLL::Init();
+}
+void Test::setUp()
+{
m_pDoc = new ScDocument;
}
void Test::tearDown()
{
delete m_pDoc;
- uno::Reference< lang::XComponent >(m_context, uno::UNO_QUERY_THROW)->dispose();
+}
+
+Test::~Test()
+{
+ uno::Reference< lang::XComponent >(m_xContext, uno::UNO_QUERY_THROW)->dispose();
}
void Test::testSUM()
commit 12f76d743d9898cd27b35fef36b2d93f74ba7d7f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 20 11:52:07 2010 +0000
declared but not defined
diff --git a/sc/inc/dpglobal.hxx b/sc/inc/dpglobal.hxx
index ac76f5a..892ecf4 100644
--- a/sc/inc/dpglobal.hxx
+++ b/sc/inc/dpglobal.hxx
@@ -189,16 +189,9 @@ protected:
namespace ScDPGlobal
{
-// used for core data
- String GetFieldFuncString( const String& rSourceName, USHORT &rFuncMask, bool bIsValue );
- com::sun::star::uno::Reference<com::sun::star::container::XNameAccess> DP_GetMembers( const com::sun::star::uno::Reference<
- com::sun::star::sheet::XDimensionsSupplier>&rSrc, long nField );
// common operation
String operator + ( const String & rL, const String &rR );
Rectangle operator *( const Rectangle &rLeft, const std::pair<double,double> & rRight );
-// used for DataPilot Panel
- ScDPInfoWnd* GetDPInfoWnd( ScTabViewShell *pViewShell );
-
}
#endif
commit 8d048b223ab107f73197bb4a38fcbe2a192caeda
Author: serval <serval2412 at yahoo.fr>
Date: Mon Dec 20 11:50:25 2010 +0000
callcatcher + 1 RTL_CONSTASCII_USTRINGPARAM
diff --git a/sc/inc/charthelper.hxx b/sc/inc/charthelper.hxx
index 0f8b4c6..b3b1dae 100644
--- a/sc/inc/charthelper.hxx
+++ b/sc/inc/charthelper.hxx
@@ -43,7 +43,6 @@ class ScChartHelper
{
public:
static USHORT DoUpdateAllCharts( ScDocument* pDoc );
- static USHORT DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc ); //use this to replace ScDBFunc::DoUpdateCharts in future
static void AdjustRangesOfChartsOnDestinationPage( ScDocument* pSrcDoc, ScDocument* pDestDoc, const SCTAB nSrcTab, const SCTAB nDestTab );
static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > GetChartFromSdrObject( SdrObject* pObject );
static void GetChartRanges( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc,
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 57de6f8..3b1cc79 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -377,7 +377,6 @@ public:
void SetGrammar( const formula::FormulaGrammar::Grammar eGrammar );
- void SetEncodeUrlMode( EncodeUrlMode eMode );
EncodeUrlMode GetEncodeUrlMode() const;
private:
/** Set grammar and reference convention from within SetFormulaLanguage()
diff --git a/sc/inc/compressedarray.hxx b/sc/inc/compressedarray.hxx
index e245b23..efc5cd7 100644
--- a/sc/inc/compressedarray.hxx
+++ b/sc/inc/compressedarray.hxx
@@ -101,11 +101,6 @@ public:
not decremented and the value of the first entry is returned again. */
const D& GetPrevValue( size_t& nIndex, A& nStart ) const;
- /** Return the last row where an entry meets the condition:
- (aValue != rCompare). If no entry meets this condition
- ::std::numeric_limits<A>::max() is returned. */
- A GetLastUnequalAccess( A nStart, const D& rCompare );
-
/** Insert rows before nStart and copy value for inserted rows from
nStart-1, return that value. */
const D& Insert( A nStart, size_t nCount );
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 0a0f4e2..2324c69 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -419,7 +419,6 @@ private:
public:
SC_DLLPUBLIC ULONG GetCellCount() const; // alle Zellen
SCSIZE GetCellCount(SCTAB nTab, SCCOL nCol) const;
- ULONG GetWeightedCount() const; // Formeln und Edit staerker gewichtet
ULONG GetCodeCount() const; // RPN-Code in Formeln
DECL_LINK( GetUserDefinedColor, USHORT * );
// Numberformatter
@@ -497,7 +496,6 @@ public:
SC_DLLPUBLIC long AddDPObjectCache( ScDPTableDataCache* pData );
SC_DLLPUBLIC void RemoveDPObjectCache( long nID );
SC_DLLPUBLIC void RemoveUnusedDPObjectCaches();
- SC_DLLPUBLIC void GetUsedDPObjectCache( std::list<ScDPTableDataCache*>& usedlist );
SC_DLLPUBLIC long GetNewDPObjectCacheId ();
// End Comments
diff --git a/sc/inc/dpcachetable.hxx b/sc/inc/dpcachetable.hxx
index 1041a05..04e1fa3 100644
--- a/sc/inc/dpcachetable.hxx
+++ b/sc/inc/dpcachetable.hxx
@@ -162,11 +162,6 @@ public:
void getValue( ScDPValueData& rVal, SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const;
String getFieldName( SCCOL nIndex) const;
- /** Get the field index (i.e. column ID in the original data source) based
- on the string value that corresponds with the column title. It returns
- -1 if no field matching the string value exists. */
- sal_Int32 getFieldIndex(const String& rStr) const;
-
/** Get the unique entries for a field specified by index. The caller must
make sure that the table is filled before calling function, or it will
get an empty collection. */
@@ -180,7 +175,6 @@ public:
const ::std::hash_set<sal_Int32>& rRepeatIfEmptyDims);
void clear();
- void swap(ScDPCacheTable& rOther);
bool empty() const;
private:
diff --git a/sc/inc/dpglobal.hxx b/sc/inc/dpglobal.hxx
index 534c4f5..ac76f5a 100644
--- a/sc/inc/dpglobal.hxx
+++ b/sc/inc/dpglobal.hxx
@@ -191,7 +191,6 @@ namespace ScDPGlobal
{
// used for core data
String GetFieldFuncString( const String& rSourceName, USHORT &rFuncMask, bool bIsValue );
- String GetFuncString( const String &rString, const USHORT nIndex );
com::sun::star::uno::Reference<com::sun::star::container::XNameAccess> DP_GetMembers( const com::sun::star::uno::Reference<
com::sun::star::sheet::XDimensionsSupplier>&rSrc, long nField );
// common operation
@@ -199,7 +198,6 @@ namespace ScDPGlobal
Rectangle operator *( const Rectangle &rLeft, const std::pair<double,double> & rRight );
// used for DataPilot Panel
ScDPInfoWnd* GetDPInfoWnd( ScTabViewShell *pViewShell );
- bool ChkDPTableOverlap( ScDocument *pDestDoc, std::list<ScDPObject> & rClipboard, SCCOL nClipStartCol, SCROW nClipStartRow, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, USHORT nEndTab, bool bExcludeClip = FALSE );
}
#endif
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 79cd8a9..4a00c6a 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -123,7 +123,6 @@ public:
// Wang Xu Ming -- 2009-8-17
// DataPilot Migration - Cache&&Performance
inline void SetRefresh() { bRefresh = TRUE; }
- const ScDPTableDataCache* GetCache() const;
long GetCacheId() const;
void SetCacheId( long nCacheId );
ULONG RefreshCache();
@@ -151,9 +150,6 @@ public:
void SetOutRange(const ScRange& rRange);
const ScRange& GetOutRange() const { return aOutRange; }
- void SetAutoFormatIndex (const sal_uInt16 nIndex);
- sal_uInt16 GetAutoFormatIndex() const;
-
void SetHeaderLayout(bool bUseGrid);
bool GetHeaderLayout() const;
diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx
index 4c2bfb1..58b176f 100644
--- a/sc/inc/dptabres.hxx
+++ b/sc/inc/dptabres.hxx
@@ -571,7 +571,6 @@ private:
ScDPResultMember* FindMember( SCROW iData ) const;
ScDPResultMember* AddMember( const ScDPParentDimData& aData );
ScDPResultMember* InsertMember( ScDPParentDimData* pMemberData );
- ResultMembers* GetResultMember( ScDPDimension* pDim, ScDPLevel* pLevel );
void InitWithMembers( LateInitParams& rParams,
const ::std::vector< SCROW >& pItemData,
size_t nPos,
diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx
index f67f26a..3fb4984 100644
--- a/sc/inc/dptabsrc.hxx
+++ b/sc/inc/dptabsrc.hxx
@@ -790,7 +790,6 @@ public:
// End Comments
virtual ~ScDPMember();
- BOOL IsNamedItem( const ScDPItemData& r ) const;
String GetNameStr() const;
void FillItemData( ScDPItemData& rData ) const;
// Wang Xu Ming -- 2009-8-17
diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx
index 9ed2de5..1c4d8bd 100644
--- a/sc/source/core/data/compressedarray.cxx
+++ b/sc/source/core/data/compressedarray.cxx
@@ -334,35 +334,6 @@ void ScCompressedArray<A,D>::Remove( A nStart, size_t nAccessCount )
pData[nCount-1].nEnd = nMaxAccess;
}
-
-template< typename A, typename D >
-A ScCompressedArray<A,D>::GetLastUnequalAccess( A nStart, const D& rCompare )
-{
- A nEnd = ::std::numeric_limits<A>::max();
- size_t nIndex = nCount-1;
- while (1)
- {
- if (pData[nIndex].aValue != rCompare)
- {
- nEnd = pData[nIndex].nEnd;
- break; // while
- }
- else
- {
- if (nIndex > 0)
- {
- --nIndex;
- if (pData[nIndex].nEnd < nStart)
- break; // while
- }
- else
- break; // while
- }
- }
- return nEnd;
-}
-
-
// === ScSummableCompressedArray =============================================
template< typename A, typename D >
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 053533e..4de92be 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -2135,20 +2135,6 @@ void ScDocument::RemoveUnusedDPObjectCaches()
}
}
-void ScDocument::GetUsedDPObjectCache( std::list<ScDPTableDataCache*>& usedlist )
-{
- for ( std::list<ScDPTableDataCache*>::iterator iter = m_listDPObjectsCaches.begin(); iter!=m_listDPObjectsCaches.end(); ++iter )
- {
- long nID = (*iter)->GetId();
- USHORT nCount = GetDPCollection()->GetCount();
- USHORT i=0;
- for ( i=0; i<nCount; i++)
- if ( nID == (*pDPCollection)[i]->GetCacheId() )
- break;
- if ( i != nCount )
- usedlist.push_back( *iter );
- }
-}
// End Comments
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index abacb00..784253a 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -5141,18 +5141,6 @@ ULONG ScDocument::GetCodeCount() const
}
-ULONG ScDocument::GetWeightedCount() const
-{
- ULONG nCellCount = 0L;
-
- for ( SCTAB nTab=0; nTab<=MAXTAB; nTab++ )
- if ( pTab[nTab] )
- nCellCount += pTab[nTab]->GetWeightedCount();
-
- return nCellCount;
-}
-
-
void ScDocument::PageStyleModified( SCTAB nTab, const String& rNewName )
{
if ( ValidTab(nTab) && pTab[nTab] )
diff --git a/sc/source/core/data/dpcachetable.cxx b/sc/source/core/data/dpcachetable.cxx
index 2a1f5d7..06c2c2f 100644
--- a/sc/source/core/data/dpcachetable.cxx
+++ b/sc/source/core/data/dpcachetable.cxx
@@ -335,11 +335,6 @@ String ScDPCacheTable::getFieldName(SCCOL nIndex) const
return getCache()->GetDimensionName( nIndex );
}
-sal_Int32 ScDPCacheTable::getFieldIndex(const String& rStr) const
-{
- return getCache()->GetDimensionIndex( rStr );
-}
-
const ::std::vector<SCROW>& ScDPCacheTable::getFieldEntries( sal_Int32 nColumn ) const
{
if (nColumn < 0 || static_cast<size_t>(nColumn) >= maFieldEntries.size())
@@ -421,12 +416,6 @@ void ScDPCacheTable::clear()
maRowsVisible.clear();
}
-void ScDPCacheTable::swap(ScDPCacheTable& rOther)
-{
- maFieldEntries.swap(rOther.maFieldEntries);
- maRowsVisible.swap(rOther.maRowsVisible);
-}
-
bool ScDPCacheTable::empty() const
{
return ( mpCache == NULL&& mpNoneCache == NULL ) || maFieldEntries.size()==0;
diff --git a/sc/source/core/data/dpglobal.cxx b/sc/source/core/data/dpglobal.cxx
index f4a41de..906a53b 100644
--- a/sc/source/core/data/dpglobal.cxx
+++ b/sc/source/core/data/dpglobal.cxx
@@ -49,52 +49,6 @@ namespace ScDPGlobal
return rcResult;
}
- String GetFuncString( const String &rString, const USHORT nIndex )
- {
- if ( nIndex <= 1 ) return rString;
- ULONG uch = rString.Len() ? rString.GetChar( rString.Len()-1 ) : (L'9'+1);
- bool bEndWithDigital = ( L'0'<=uch && uch<=L'9');
- char szTemp[__MAX_NUM_LEN+1];
- int nLen = sprintf( szTemp, bEndWithDigital ? DATA_RENAME_SEPARATOR"%hu" : "%hu", nIndex );
- String strRet = rString;
- strRet.Append( String::CreateFromAscii( szTemp, static_cast<USHORT>(nLen) ));
- return strRet;
- }
-
- bool ChkDPTableOverlap( ScDocument *pDestDoc, std::list<ScDPObject> & rClipboard, SCCOL nClipStartCol, SCROW nClipStartRow, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, USHORT nEndTab, BOOL bExcludeClip /*= FALSE*/ )
- {
- if (ScDPCollection* pDPCollection = pDestDoc->GetDPCollection())
- {
- USHORT nCount = pDPCollection->GetCount();
- SCsCOL nOffsetX = nStartCol - nClipStartCol;
- SCsROW nOffsetY = nStartRow - nClipStartRow;
-
- for (std::list<ScDPObject>::iterator iter = rClipboard.begin(); iter!=rClipboard.end(); iter++)
- {
- ScRange aRange = iter->GetOutRange();
-
- for (USHORT nCurrTab = nStartTab; nCurrTab<=nEndTab; nCurrTab++)
- {
- SCsTAB nOffsetZ = nCurrTab - aRange.aStart.Tab();
- aRange.Move( nOffsetX, nOffsetY, nOffsetZ );
-
- for (USHORT i = 0; i<nCount; i++)
- {
- if ((*pDPCollection)[i] && aRange.Intersects( (*pDPCollection)[i]->GetOutRange()))
- {
- if (bExcludeClip && iter->GetOutRange() == (*pDPCollection)[i]->GetOutRange())
- {
- continue;
- }
- return false;
- }
- }
- }
- }
- }
- return true;
- }
-
}
ScDPItemDataPool::ScDPItemDataPool()
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 72bbadc..0a8a629 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -256,16 +256,6 @@ void ScDPObject::SetSaveData(const ScDPSaveData& rData)
InvalidateData(); // re-init source from SaveData
}
-void ScDPObject::SetAutoFormatIndex(const sal_uInt16 nIndex)
-{
- mnAutoFormatIndex = nIndex;
-}
-
-sal_uInt16 ScDPObject::GetAutoFormatIndex() const
-{
- return mnAutoFormatIndex;
-}
-
void ScDPObject::SetHeaderLayout (bool bUseGrid)
{
mbHeaderLayout = bUseGrid;
@@ -1837,7 +1827,7 @@ void lcl_FillOldFields(
try
{
if (nOrient == sheet::DataPilotFieldOrientation_DATA)
- xDimProp->getPropertyValue(OUString::createFromAscii(SC_UNO_REFVALUE))
+ xDimProp->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_REFVALUE)))
>>= rField.maFieldRef;
}
catch (uno::Exception&)
@@ -2629,10 +2619,6 @@ void ScDPObject::SetCacheId( long nCacheId )
mnCacheId = nCacheId;
}
}
-const ScDPTableDataCache* ScDPObject::GetCache() const
-{
- return pDoc->GetDPObjectCache( GetCacheId() );
-}
// End Comments
void ScDPCollection::FreeTable(ScDPObject* pDPObj)
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 2ce7545..f7e7eca 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -3949,27 +3949,6 @@ ScDPResultMember* ScDPResultDimension::AddMember(const ScDPParentDimData &aData
return pMember;
}
-ResultMembers* ScDPResultDimension::GetResultMember( ScDPDimension* pThisDim, ScDPLevel* pThisLevel )
-{
- ResultMembers* pResultMembers = new ResultMembers();
- // global order is used to initialize aMembers, so it doesn't have to be looked at later
- const ScMemberSortOrder& rGlobalOrder = pThisLevel->GetGlobalOrder();
-
- ScDPMembers* pMembers = pThisLevel->GetMembersObject();
- long nMembCount = pMembers->getCount();
- for ( long i=0; i<nMembCount; i++ )
- {
- long nSorted = rGlobalOrder.empty() ? i : rGlobalOrder[i];
- ScDPMember* pMember = pMembers->getByIndex(nSorted);
- if ( NULL == pResultMembers->FindMember( pMember->GetItemDataId() ) )
- {
- ScDPParentDimData* pNew = new ScDPParentDimData( i, pThisDim, pThisLevel, pMember );
- pResultMembers->InsertMember( pNew );
- }
- }
- return pResultMembers;
-}
-
ScDPResultMember* ScDPResultDimension::InsertMember(ScDPParentDimData *pMemberData)
{
SCROW nInsert = 0;
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
index b75dd43..653446d 100644
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -2657,22 +2657,6 @@ ScDPMember::~ScDPMember()
//! release pSource
}
-BOOL ScDPMember::IsNamedItem( const ScDPItemData& r ) const
-{
- long nSrcDim = pSource->GetSourceDim( nDim );
- if ( nHier != SC_DAPI_HIERARCHY_FLAT && pSource->IsDateDimension( nSrcDim ) && r.IsValue() )
- {
- long nComp = pSource->GetData()->GetDatePart(
- (long)::rtl::math::approxFloor( r.GetValue() ),
- nHier, nLev );
-
- // fValue is converted from integer, so simple comparison works
- return nComp == GetItemData().GetValue();
- }
-
- return r.IsCaseInsEqual( GetItemData() );
-}
-
BOOL ScDPMember::IsNamedItem( SCROW nIndex ) const
{
long nSrcDim = pSource->GetSourceDim( nDim );
diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx
index 5d7e108..441b18f 100644
--- a/sc/source/core/tool/charthelper.cxx
+++ b/sc/source/core/tool/charthelper.cxx
@@ -126,13 +126,6 @@ BOOL lcl_AdjustRanges( ScRangeList& rRanges, SCTAB nSourceTab, SCTAB nDestTab, S
}//end anonymous namespace
// === ScChartHelper ======================================
-
-//static
-USHORT ScChartHelper::DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc )
-{
- return lcl_DoUpdateCharts( rPos, pDoc, FALSE );
-}
-
//static
USHORT ScChartHelper::DoUpdateAllCharts( ScDocument* pDoc )
{
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 5d5f0e4..8ff8274 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -371,11 +371,6 @@ void ScCompiler::SetGrammar( const FormulaGrammar::Grammar eGrammar )
}
}
-void ScCompiler::SetEncodeUrlMode( EncodeUrlMode eMode )
-{
- meEncodeUrlMode = eMode;
-}
-
ScCompiler::EncodeUrlMode ScCompiler::GetEncodeUrlMode() const
{
return meEncodeUrlMode;
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index bdfdd1a..8607654 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1640,11 +1640,4 @@ GetTabPageRanges ScAbstractDialogFactory_Impl::GetTabPageRangesFunc( USHORT nId
return 0;
}
-void ScDPFunctionDlg_Dummy()
-{
- // use ScDPListBoxWrapper to avoid warning (this isn't called)
- ListBox* pListBox = NULL;
- ScDPListBoxWrapper aWrapper( *pListBox );
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 3f7bde145d8ae85e0700b2d75dac36098c9722f0
Merge: d1dd018... a619953...
Author: Jan Holesovsky <kendy at suse.cz>
Date: Mon Dec 20 01:15:52 2010 +0100
Merge commit 'libreoffice-3.3.0.2'
commit d1dd01814d169a571ac382cf446e299b8a4bdd26
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Dec 19 16:24:55 2010 +0000
cppcheck: prefer prefix variant
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index 0c7a1f1..e384163 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -218,7 +218,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r
const tTemplateServiceChartTypeParameterMap::const_iterator aEnd = rMap.end();
for( sal_Int32 nMatchPrecision=0; nMatchPrecision<7 && !bFoundSomeMatch; nMatchPrecision++ )
{
- for( aIter = rMap.begin(); aIter != aEnd; aIter++ )
+ for( aIter = rMap.begin(); aIter != aEnd; ++aIter )
{
if( rParameter.mapsToSimilarService( (*aIter).second, nMatchPrecision ) )
{
@@ -263,7 +263,7 @@ rtl::OUString ChartTypeDialogController::getServiceNameForParameter( const Chart
const tTemplateServiceChartTypeParameterMap& rMap = getTemplateMap();
tTemplateServiceChartTypeParameterMap::const_iterator aIter = rMap.begin();
const tTemplateServiceChartTypeParameterMap::const_iterator aEnd = rMap.end();
- for( ; aIter != aEnd; aIter++ )
+ for( ; aIter != aEnd; ++aIter )
{
if( aParameter.mapsToSameService( (*aIter).second ) )
return (*aIter).first;
@@ -272,7 +272,7 @@ rtl::OUString ChartTypeDialogController::getServiceNameForParameter( const Chart
OSL_ENSURE( false, "ChartType not implemented yet - use fallback to similar type" );
for( sal_Int32 nMatchPrecision=1; nMatchPrecision<8; nMatchPrecision++ )
{
- for( aIter = rMap.begin(); aIter != aEnd; aIter++ )
+ for( aIter = rMap.begin(); aIter != aEnd; ++aIter )
{
if( aParameter.mapsToSimilarService( (*aIter).second, nMatchPrecision ) )
return (*aIter).first;
commit a619953e638d7579f688674e9f7ce3a1042d5db5
Author: Petr Mladek <pmladek at suse.cz>
Date: Sat Dec 18 20:35:15 2010 +0100
Version 3.3.0.2, tag libreoffice-3.3.0.2 (3.3-rc2)
commit 0cd69aa9e2d5738261e0ff513a1ab0354d7a9e64
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Dec 18 19:09:04 2010 +0000
cppcheck: can reduce the scope of this variable
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 33f7068..e402056 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -441,7 +441,6 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, BOOL bInner )
long nPosY = rOffset.Y();
long nSizeX = rSize.Width();
long nSizeY = rSize.Height();
- long nSize1;
bMinimized = ( nSizeX<=SC_ICONSIZE || nSizeY<=SC_ICONSIZE );
if ( bMinimized )
@@ -608,7 +607,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, BOOL bInner )
nBarY = aHScrollLeft.GetSizePixel().Height();
nBarX = aVScrollBottom.GetSizePixel().Width();
- nSize1 = nSizeX + nOverlap;
+ long nSize1 = nSizeX + nOverlap;
long nTabSize = nSize1;
if (nTabSize < 0) nTabSize = 0;
commit 58eaad24d878fbf08c5fd6762230428bd30f5e83
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Fri Dec 17 19:13:55 2010 -0500
When inserting current date/time, set cell format only when necessary.
When the cell already has date or time format set, don't overwrite it
when inserting current date or time.
diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index 2aa8aaa..51e0179 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -36,6 +36,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/sound.hxx>
#include "svl/zforlist.hxx"
+#include "svl/zformat.hxx"
#include "viewfunc.hxx"
#include "detfunc.hxx"
@@ -302,7 +303,13 @@ void ScViewFunc::InsertCurrentTime(short nCellFmt, const OUString& rUndoStr)
fTime /= D_TIMEFACTOR;
pUndoMgr->EnterListAction(rUndoStr, rUndoStr);
pDocSh->GetDocFunc().PutCell(aCurPos, new ScValueCell(fDate+fTime), false);
- SetNumberFormat(nCellFmt);
+
+ // Set the new cell format only when it differs from the current cell
+ // format type.
+ sal_uInt32 nCurNumFormat = pDoc->GetNumberFormat(aCurPos);
+ const SvNumberformat* pEntry = pFormatter->GetEntry(nCurNumFormat);
+ if (!pEntry || !(pEntry->GetType() & nCellFmt))
+ SetNumberFormat(nCellFmt);
pUndoMgr->LeaveListAction();
}
commit 78cf196f25be1ebde2a23474024edcb4b7c84ea2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 17 20:43:45 2010 +0000
WaE: C4805: Unsafe mix of bool and BOOL
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index e415c0e..a57152e 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -225,7 +225,7 @@ ScDrawLayer* ScDocShell::MakeDrawLayer()
InitItems(); // incl. Undo und Basic
Broadcast( SfxSimpleHint( SC_HINT_DRWLAYER_NEW ) );
if (nDocumentLock)
- pDrawLayer->setLock(TRUE);
+ pDrawLayer->setLock(true);
}
return pDrawLayer;
}
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 31f04a5..9ba6a7f 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -289,7 +289,7 @@ void ScDocShell::LockDocument_Impl(USHORT nNew)
{
ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
if (pDrawLayer)
- pDrawLayer->setLock(TRUE);
+ pDrawLayer->setLock(true);
}
nDocumentLock = nNew;
}
@@ -301,7 +301,7 @@ void ScDocShell::UnlockDocument_Impl(USHORT nNew)
{
ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
if (pDrawLayer)
- pDrawLayer->setLock(FALSE);
+ pDrawLayer->setLock(false);
}
}
commit bd80366a3ff7e209450813c78ec6963ffc55ef96
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Fri Dec 17 14:48:10 2010 -0500
Use the current cursor position when expanding a selection.
When expanding a selection via shift-ctrl-<arrow key> use the
current cursor position to deteremine how much the current selection
should be expanded. The old way was to use the block end position
which is is diagonally opposite of the cursor position. (n#659795)
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 6b7671b..73daaac 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -450,8 +450,12 @@ void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode
}
else if (IsBlockMode())
{
+ // block end position.
nNewX = nBlockEndX;
nNewY = nBlockEndY;
+ // cursor position - diagonally opposite of the block end position.
+ nCurX = aViewData.GetCurX();
+ nCurY = aViewData.GetCurY();
}
else
{
@@ -467,16 +471,16 @@ void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode
SCsCOLROW i;
if ( nMovX > 0 )
for ( i=0; i<nMovX; i++ )
- pDoc->FindAreaPos( nNewX, nNewY, nTab, 1, 0 );
+ pDoc->FindAreaPos( nNewX, nCurY, nTab, 1, 0 );
if ( nMovX < 0 )
for ( i=0; i<-nMovX; i++ )
- pDoc->FindAreaPos( nNewX, nNewY, nTab, -1, 0 );
+ pDoc->FindAreaPos( nNewX, nCurY, nTab, -1, 0 );
if ( nMovY > 0 )
for ( i=0; i<nMovY; i++ )
- pDoc->FindAreaPos( nNewX, nNewY, nTab, 0, 1 );
+ pDoc->FindAreaPos( nCurX, nNewY, nTab, 0, 1 );
if ( nMovY < 0 )
for ( i=0; i<-nMovY; i++ )
- pDoc->FindAreaPos( nNewX, nNewY, nTab, 0, -1 );
+ pDoc->FindAreaPos( nCurX, nNewY, nTab, 0, -1 );
if (eMode==SC_FOLLOW_JUMP) // unten/rechts nicht zuviel grau anzeigen
{
commit f2304a56023c6c391ac82314db601d524b28a99e
Author: Anders Jonsson <anders.jonsson at norsjonet.se>
Date: Thu Dec 16 20:30:38 2010 +0100
Remove large block of unused code
diff --git a/chart2/source/tools/ChartDebugTrace.cxx b/chart2/source/tools/ChartDebugTrace.cxx
index 842f0d4..c74b59d 100644
--- a/chart2/source/tools/ChartDebugTrace.cxx
+++ b/chart2/source/tools/ChartDebugTrace.cxx
@@ -50,266 +50,7 @@ using ::rtl::OUString;
namespace
{
-/*
-const char lcl_aSpace=' ';
-void lcl_IndentedTrace( int nIndent, char* pStr )
-{
- if( nIndent > 0 )
- {
- OSL_TRACE( "%*c%s", nIndent, lcl_aSpace, pStr );
- }
- else
- {
- OSL_TRACE( pStr );
- }
-}
-
-void lcl_TraceException( const uno::Exception & aEx )
-{
- OSL_TRACE(
- U2C( C2U( "*** Exception caught during trace. Type: " ) +
- OUString::createFromAscii( typeid( aEx ).name()) +
- C2U( ", Message: " ) +
- aEx.Message ));
-}
-
-void lcl_TraceCategories( const Reference< data::XLabeledDataSequence > & xCat, int nIndent )
-{
- if( ! xCat.is())
- return;
- try
- {
- Reference< data::XDataSequence > xValues( xCat->getValues());
- if( xValues.is())
- {
- OSL_TRACE( "%*ccategories: source: %s", nIndent, lcl_aSpace,
- U2C( xValues->getSourceRangeRepresentation()));
- }
- Reference< data::XDataSequence > xLabel( xCat->getLabel());
- if( xLabel.is())
- {
- OSL_TRACE( "%*ccategories' label: source: %s", nIndent, lcl_aSpace,
- U2C( xLabel->getSourceRangeRepresentation()));
- }
- }
- catch( uno::Exception & ex )
- {
- lcl_TraceException( ex );
- }
-}
-
-void lcl_TraceDataSeriesSeq( const Sequence< Reference< XDataSeries > > & aSeries, int nIndent )
-{
- for( sal_Int32 j = 0; j < aSeries.getLength(); ++j )
- {
- Reference< beans::XPropertySet > xProp( aSeries[j], uno::UNO_QUERY );
- OUString aId;
-
- OSL_TRACE( "%*cindex %ld", nIndent, lcl_aSpace, j );
-
- StackingDirection aStDir;
- if( xProp.is() &&
- ( xProp->getPropertyValue( C2U( "StackingDirection" )) >>= aStDir ) &&
- aStDir != StackingDirection_NO_STACKING )
- {
- OSL_TRACE( "%*cstacking in %s", nIndent + 2, lcl_aSpace,
- (aStDir == StackingDirection_Y_STACKING)
- ? "y-direction" : "z-direction" );
- }
-
- Reference< data::XDataSource > xSource( aSeries[j], uno::UNO_QUERY );
- if( xSource.is())
- {
- Sequence< Reference< data::XLabeledDataSequence > > aSequences( xSource->getDataSequences());
- const sal_Int32 nMax = aSequences.getLength();
- for( sal_Int32 k = 0; k < nMax; ++k )
- {
- if( aSequences[k].is())
- {
- OUString aSourceId(C2U("<none>"));
- if( aSequences[k]->getValues().is())
- aSourceId = aSequences[k]->getValues()->getSourceRangeRepresentation();
- xProp.set( aSequences[k]->getValues(), uno::UNO_QUERY );
- if( xProp.is() &&
- ( xProp->getPropertyValue( C2U( "Role" )) >>= aId ))
- {
- OSL_TRACE( "%*cdata sequence %d: role: %s, source: %s",
- nIndent + 2, lcl_aSpace, k, U2C( aId ), U2C( aSourceId ));
- }
- else
- {
- OSL_TRACE( "%*cdata sequence %d, unknown role, source: %s",
- nIndent + 2, lcl_aSpace, k, U2C( aSourceId ) );
- }
-
- aSourceId = C2U("<none>");
- if( aSequences[k]->getLabel().is())
- aSourceId = OUString( aSequences[k]->getLabel()->getSourceRangeRepresentation());
- xProp.set( aSequences[k]->getLabel(), uno::UNO_QUERY );
- if( xProp.is() &&
- ( xProp->getPropertyValue( C2U( "Role" )) >>= aId ))
- {
- OSL_TRACE( "%*cdata sequence label %d: role: %s, source: %s",
- nIndent + 2, lcl_aSpace, k, U2C( aId ), U2C( aSourceId ));
- }
- else
- {
- OSL_TRACE( "%*cdata sequence label %d: unknown role, source: %s",
- nIndent + 2, lcl_aSpace, k, U2C( aSourceId ) );
- }
- }
- }
- }
- }
-}
-
-void lcl_TraceChartType( const Reference< XChartType > & xChartType, int nIndent )
-{
- if( xChartType.is())
- {
- OSL_TRACE( "%*c* type: %s", nIndent, lcl_aSpace, U2C( xChartType->getChartType()) );
-
- lcl_IndentedTrace( nIndent + 2, "Supported Roles" );
- sal_Int32 i=0;
- Sequence< OUString > aMandRoles( xChartType->getSupportedMandatoryRoles());
- if( aMandRoles.getLength() > 0 )
- {
- lcl_IndentedTrace( nIndent + 4, "mandatory" );
- for( i=0; i<aMandRoles.getLength(); ++i )
- {
- OSL_TRACE( "%*c%s", nIndent + 6, lcl_aSpace, U2C( aMandRoles[i] ));
- }
- }
- Sequence< OUString > aOptRoles( xChartType->getSupportedOptionalRoles());
- if( aOptRoles.getLength() > 0 )
- {
- lcl_IndentedTrace( nIndent + 4, "optional" );
- for( i=0; i<aOptRoles.getLength(); ++i )
- {
- OSL_TRACE( "%*c%s", nIndent + 6, lcl_aSpace, U2C( aOptRoles[i] ));
- }
- }
- OSL_TRACE( "%*crole of sequence for label: %s", nIndent + 2, lcl_aSpace,
- U2C( xChartType->getRoleOfSequenceForSeriesLabel()));
-
- Reference< XDataSeriesContainer > xDSCnt( xChartType, uno::UNO_QUERY );
- if( xDSCnt.is())
- {
- lcl_IndentedTrace( nIndent + 2, "Data Series" );
- lcl_TraceDataSeriesSeq( xDSCnt->getDataSeries(), nIndent + 4 );
- }
- }
-}
-
-void lcl_TraceCoordinateSystem( const Reference< XCoordinateSystem > & xCooSys, int nIndent )
-{
- if( xCooSys.is()) try
- {
- sal_Int32 nDim = xCooSys->getDimension();
- OSL_TRACE( "%*c* dim: %ld, type: %s", nIndent, lcl_aSpace,
- nDim, U2C( xCooSys->getCoordinateSystemType() ));
- nIndent += 2;
- OSL_TRACE( "%*cview service-name: %s", nIndent, lcl_aSpace,
- U2C( xCooSys->getViewServiceName() ));
-
- Reference< beans::XPropertySet > xProp( xCooSys, uno::UNO_QUERY );
- if( xProp.is())
- {
- Reference< beans::XPropertySetInfo > xInfo( xProp->getPropertySetInfo(), uno::UNO_QUERY );
- sal_Bool bSwap;
- if( xInfo.is() &&
- xInfo->hasPropertyByName( C2U("SwapXAndYAxis")) &&
- (xProp->getPropertyValue( C2U("SwapXAndYAxis")) >>= bSwap) &&
- bSwap )
- {
- lcl_IndentedTrace( nIndent, "swap x-axis and y-axis" );
- }
- }
-
- if( nDim >= 2 )
- {
- const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(1);
- for(sal_Int32 nI=0; nI<=nMaxIndex; ++nI)
- {
- Reference< XScale > xScale( xCooSys->getAxisByDimension( 1, nI ));
- if( xScale.is())
- {
- ScaleData aData( xScale->getScaleData());
- if( aData.AxisType==AxisType::PERCENT )
- lcl_IndentedTrace( nIndent, "percent stacking at y-scale" );
- }
- }
- }
-
- Sequence< uno::Any > aOrigin( xCooSys->getOrigin());
- double x, y, z;
- ::rtl::math::setNan( &x ), ::rtl::math::setNan( &y ), ::rtl::math::setNan( &z );
- if( aOrigin.getLength() > 0 &&
- aOrigin[0].hasValue() )
- aOrigin[0] >>= x;
- if( aOrigin.getLength() > 1 &&
- aOrigin[1].hasValue() )
- aOrigin[1] >>= y;
- if( aOrigin.getLength() > 2 &&
- aOrigin[2].hasValue() )
- aOrigin[2] >>= z;
- OSL_TRACE( "%*corigin: (%f, %f, %f)", nIndent, lcl_aSpace, x, y, z );
-
- Reference< XChartTypeContainer > xCTCnt( xCooSys, uno::UNO_QUERY );
- if( xCTCnt.is())
- {
- Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes());
- if( aChartTypes.getLength() > 0 )
- {
- lcl_IndentedTrace( nIndent, "Chart Types" );
- for( sal_Int32 i=0; i<aChartTypes.getLength(); ++i )
- {
- lcl_TraceChartType( aChartTypes[i], nIndent + 2 );
- }
- }
- }
- }
- catch( uno::Exception & ex )
- {
- lcl_TraceException( ex );
- }
-}
-
-void lcl_TraceMeter(
- const Reference< XMeter > & xMeter,
- const Sequence< Reference< XCoordinateSystem > > & aCooSys,
- bool bWithCategories,
- int nIndent )
-{
- try
- {
- Reference< XCoordinateSystem > xCooSys( xMeter->getCoordinateSystem());
- for( sal_Int32 i=0; i<aCooSys.getLength(); ++i )
- if( aCooSys[i] == xCooSys )
- {
- OSL_TRACE( "%*cbelongs to Coordinate System %ld.", nIndent + 2, lcl_aSpace, i );
- }
- OSL_TRACE( "%*crepresents Dimension %ld.", nIndent + 2, lcl_aSpace, xMeter->getRepresentedDimension());
- if( bWithCategories )
- {
- Reference< XScale > xScale( xCooSys->getAxisByDimension( xMeter->getRepresentedDimension(), xMeter->getIndex() ));
- if( xScale.is())
- {
- ScaleData aData = xScale->getScaleData();
- if( aData.Categories.is())
- {
- lcl_TraceCategories( aData.Categories, nIndent + 2 );
- }
- }
- }
- }
- catch( uno::Exception & ex )
- {
- lcl_TraceException( ex );
- }
-}
-*/
} // anonymous namespace
#endif
@@ -325,92 +66,14 @@ void ChartDebugTraceDocument(
const Reference< XChartDocument > & /*xDoc*/,
int /*nIndent*/ )
{
- /*
-#if OSL_DEBUG_LEVEL >= CHART_TRACE_OSL_DEBUG_LEVEL
- try
- {
- OSL_TRACE( "%*cas %sternal data", nIndent, 'h',
- xDoc->hasInternalDataProvider() ? "in": "ex" );
- Reference< lang::XMultiServiceFactory > xCTManager( xDoc->getChartTypeManager(), uno::UNO_QUERY );
- if( xCTManager.is())
- {
- Sequence< OUString > aServiceNames( xCTManager->getAvailableServiceNames());
- OSL_TRACE( "%*c ChartTypeManager has %ld entries", nIndent, '*', aServiceNames.getLength());
-# if OSL_DEBUG_LEVEL >= (CHART_TRACE_OSL_DEBUG_LEVEL + 1)
- for( sal_Int32 i=0; i<aServiceNames.getLength(); ++i )
- {
- OSL_TRACE( "%*c%s", nIndent + 2, lcl_aSpace, U2C( aServiceNames[i] ));
- }
-# endif
- }
- Reference< XDiagram > xDiagram( xDoc->getFirstDiagram());
- lcl_IndentedTrace( nIndent, "* Diagram" );
- ChartDebugTraceDiagram( xDiagram, nIndent + 2 );
- }
- catch( uno::Exception & ex )
- {
- lcl_TraceException( ex );
- }
-#endif
- */
}
void ChartDebugTraceDiagram(
const Reference< XDiagram > & /*xDiagram*/,
int /*nIndent*/ )
{
- /*
-#if OSL_DEBUG_LEVEL >= CHART_TRACE_OSL_DEBUG_LEVEL
- try
- {
- Reference< XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
- Sequence< Reference< XCoordinateSystem > > aCooSys( xCooSysCnt->getCoordinateSystems() );
- if( aCooSys.getLength() > 0 )
- {
- lcl_IndentedTrace( nIndent, "CoordinateSystems" );
- for( sal_Int32 i=0; i<aCooSys.getLength(); ++i )
- lcl_TraceCoordinateSystem( aCooSys[i], nIndent + 2 );
- }
- else
- {
- lcl_IndentedTrace( nIndent, "<No Coordinate Systems>" );
- }
-
- Reference< XAxisContainer > xAxisCnt( xDiagram, uno::UNO_QUERY_THROW );
- Sequence< Reference< XAxis > > aAxes( xAxisCnt->getAxes() );
- if( aAxes.getLength() > 0 )
- {
- lcl_IndentedTrace( nIndent, "Axes" );
- for( sal_Int32 i=0; i<aAxes.getLength(); ++i )
- lcl_TraceMeter( Reference< XMeter >( aAxes[i], uno::UNO_QUERY ), aCooSys, true, nIndent + 2 );
- }
- else
- {
- lcl_IndentedTrace( nIndent, "<No Axes>" );
- }
-
- Reference< XGridContainer > xGridCnt( xDiagram, uno::UNO_QUERY_THROW );
- Sequence< Reference< XGrid > > aGrids( xGridCnt->getGrids() );
- if( aGrids.getLength() > 0 )
- {
- lcl_IndentedTrace( nIndent, "Grids" );
- for( sal_Int32 i=0; i<aGrids.getLength(); ++i )
- lcl_TraceMeter( Reference< XMeter >( aGrids[i], uno::UNO_QUERY ), aCooSys, false, nIndent + 2 );
- }
- else
- {
- lcl_IndentedTrace( nIndent, "<No Grids>" );
- }
- }
- catch( uno::Exception & ex )
- {
- lcl_TraceException( ex );
- }
-
-#endif
-*/
}
#endif
commit fa24ee0dc6ea574a0b702c2455849fe065d79064
Author: Pierre-André Jacquod <pjacquod at alumni.ethz.ch>
Date: Thu Dec 16 21:26:42 2010 +0100
fix compiling error with --enable-dbgutil
the pDoc variable has been removed with commit:
1ce7fb1258d86287a9aea the 2010-11-06 07:49:11
hence removing it form the DBG_ASSERT( pDoc || xSource.is(),
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 2df47c7..72bbadc 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2169,8 +2169,8 @@ void ScDPObject::ConvertOrientation(
const Reference<XDimensionsSupplier>& xSource,
vector<PivotField>* pRefColFields, vector<PivotField>* pRefRowFields, vector<PivotField>* pRefPageFields )
{
- // pDoc or xSource must be set
- DBG_ASSERT( pDoc || xSource.is(), "missing string source" );
+ // xSource must be set
+ DBG_ASSERT( xSource.is(), "missing string source" );
vector<PivotField>::const_iterator itr, itrBeg = rFields.begin(), itrEnd = rFields.end();
for (itr = itrBeg; itr != itrEnd; ++itr)
commit f6727dc6d3d44285a4571f0b599c94cddb7b4531
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 16 12:13:23 2010 +0000
cppcheck: can be const
diff --git a/sc/source/ui/vba/vbachartobject.cxx b/sc/source/ui/vba/vbachartobject.cxx
index 839b7cf..99fcbef 100644
--- a/sc/source/ui/vba/vbachartobject.cxx
+++ b/sc/source/ui/vba/vbachartobject.cxx
@@ -205,7 +205,7 @@ ScVbaChartObject::setTop(double _fTop)
}
uno::Reference< uno::XInterface >
-ScVbaChartObject::getUnoObject() throw (script::BasicErrorException)
+ScVbaChartObject::getUnoObject() const throw (script::BasicErrorException)
{
return uno::Reference< uno::XInterface >( xShape, uno::UNO_QUERY );
}
diff --git a/sc/source/ui/vba/vbachartobject.hxx b/sc/source/ui/vba/vbachartobject.hxx
index 4e995d9..ad816b6 100644
--- a/sc/source/ui/vba/vbachartobject.hxx
+++ b/sc/source/ui/vba/vbachartobject.hxx
@@ -75,7 +75,7 @@ public:
void setTop( double _ftop );
// should make this part of the XHelperInterface with a default
// implementation returning NULL
- css::uno::Reference< css::uno::XInterface > getUnoObject() throw ( css::script::BasicErrorException );
+ css::uno::Reference< css::uno::XInterface > getUnoObject() const throw ( css::script::BasicErrorException );
};
#endif //SC_VBA_WINDOW_HXX
commit ec9b926fcbee47497eb36f1f520df8303c140afd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 16 11:47:18 2010 +0000
cppcheck: can reduce the scope of this variable
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 8e7f000..4a5a293 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -280,7 +280,6 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
// progress bar
// only text (title is still needed, for the cancel button)
ScProgress aProgress( &rDocShell, ScGlobal::GetRscString(STR_UNDO_IMPORTDATA), 0 );
- USHORT nInserted = 0;
uno::Reference<sdbc::XRowSet> xRowSet = uno::Reference<sdbc::XRowSet>(
xResultSet, uno::UNO_QUERY );
@@ -380,6 +379,7 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
BOOL bEnd = FALSE;
if ( !bDoSelection )
xRowSet->beforeFirst();
+ USHORT nInserted = 0;
while ( !bEnd )
{
// skip rows that are not selected
commit c1fe450afdc7234c549de3dfac61a620ff213169
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Dec 13 16:02:21 2010 -0500
Remove trailing spaces too when parsing csv's simple numbers.
diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx
index dcf6d57..e9a60a5 100644
--- a/sc/inc/stringutil.hxx
+++ b/sc/inc/stringutil.hxx
@@ -77,6 +77,8 @@ public:
* don't do any elaborate parsing here; we only check for the simplest
* case of decimal number format.
*
+ * Note that preceding and trailing spaces are ignored during parsing.
+ *
* @param rStr string to parse
* @param dsep decimal separator
* @param gsep group separator (aka thousands separator)
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index 83e31f7..1953aae 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -58,13 +58,14 @@ bool ScStringUtil::parseSimpleNumber(
gsep = 0x0020;
OUStringBuffer aBuf;
+
+ sal_Int32 i = 0;
sal_Int32 n = rStr.getLength();
const sal_Unicode* p = rStr.getStr();
+ const sal_Unicode* pLast = p + (n-1);
sal_Int32 nPosDSep = -1, nPosGSep = -1;
sal_uInt32 nDigitCount = 0;
- sal_Int32 i = 0;
-
// Skip preceding spaces.
for (i = 0; i < n; ++i, ++p)
{
@@ -78,7 +79,16 @@ bool ScStringUtil::parseSimpleNumber(
// the whole string is space. Fail.
return false;
- n -= i; // Subtract the length of preceding space.
+ n -= i; // Subtract the length of the preceding spaces.
+
+ // Determine the last non-space character.
+ for (; p != pLast; --pLast, --n)
+ {
+ sal_Unicode c = *pLast;
+ if (c != 0x0020 && c != 0x00A0)
+ // Non space character. Exit.
+ break;
+ }
for (i = 0; i < n; ++i, ++p)
{
commit d81a90edf1c9e17eaaff77cb00d49051a5a7d151
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 13 20:53:21 2010 +0000
WaE, shadowed warning
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index dbd9306..83e31f7 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -80,7 +80,7 @@ bool ScStringUtil::parseSimpleNumber(
n -= i; // Subtract the length of preceding space.
- for (sal_Int32 i = 0; i < n; ++i, ++p)
+ for (i = 0; i < n; ++i, ++p)
{
sal_Unicode c = *p;
if (c == 0x00A0)
commit c2e6be18f38240106a3811445d993d35be12a790
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Dec 13 15:37:45 2010 -0500
We need to reset i to 0 after parsing spaces.
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index 136b0be..dbd9306 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -74,7 +74,13 @@ bool ScStringUtil::parseSimpleNumber(
break;
}
- for (; i < n; ++i, ++p)
+ if (i == n)
+ // the whole string is space. Fail.
+ return false;
+
+ n -= i; // Subtract the length of preceding space.
+
+ for (sal_Int32 i = 0; i < n; ++i, ++p)
{
sal_Unicode c = *p;
if (c == 0x00A0)
commit 6a28e8397ae7a913dc7af1d2bcb3590ce975c1ac
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Dec 13 15:17:30 2010 -0500
The previous commit would skip *all* spaces. This is the right fix.
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index 31efe6a..136b0be 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -63,17 +63,24 @@ bool ScStringUtil::parseSimpleNumber(
sal_Int32 nPosDSep = -1, nPosGSep = -1;
sal_uInt32 nDigitCount = 0;
- for (sal_Int32 i = 0; i < n; ++i, ++p)
+ sal_Int32 i = 0;
+
+ // Skip preceding spaces.
+ for (i = 0; i < n; ++i, ++p)
+ {
+ sal_Unicode c = *p;
+ if (c != 0x0020 && c != 0x00A0)
+ // first non-space character. Exit.
+ break;
+ }
+
+ for (; i < n; ++i, ++p)
{
sal_Unicode c = *p;
if (c == 0x00A0)
// unicode space to ascii space
c = 0x0020;
- if (c == 0x0020)
- // Skip preceding spaces.
- continue;
-
if (sal_Unicode('0') <= c && c <= sal_Unicode('9'))
{
// this is a digit.
commit 15254fc821d2bbed205e814c689b19cafaf1eb8a
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Dec 13 14:55:13 2010 -0500
When parsing numbers, ignore preceding spaces.
Also, increment the char pointer and use it directly, which is
faster than accessing char via [] in each iteration.
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index ae73746..31efe6a 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -63,13 +63,17 @@ bool ScStringUtil::parseSimpleNumber(
sal_Int32 nPosDSep = -1, nPosGSep = -1;
sal_uInt32 nDigitCount = 0;
- for (sal_Int32 i = 0; i < n; ++i)
+ for (sal_Int32 i = 0; i < n; ++i, ++p)
{
- sal_Unicode c = p[i];
+ sal_Unicode c = *p;
if (c == 0x00A0)
// unicode space to ascii space
c = 0x0020;
+ if (c == 0x0020)
+ // Skip preceding spaces.
+ continue;
+
if (sal_Unicode('0') <= c && c <= sal_Unicode('9'))
{
// this is a digit.
commit a0bdbcf6481ab9176a7c763284991887d00161ff
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Dec 7 23:02:02 2010 -0500
Make the string 'New Record' localizable. (fdo#32209)
This string was hard-coded in the code to be always in English. This
change makes it localizable.
Signed-off-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/ui/inc/datafdlg.hrc b/sc/source/ui/inc/datafdlg.hrc
index eb6b3fe..b32e0a9 100644
--- a/sc/source/ui/inc/datafdlg.hrc
+++ b/sc/source/ui/inc/datafdlg.hrc
@@ -38,3 +38,5 @@
#define FT_DATAFORM_FIXEDTEXT1 2001
#define ED_DATAFORM_EDIT1 2002
+
+#define STR_NEW_RECORD 2003
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index 50503e2..3e859e9 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -286,7 +286,7 @@ void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/)
aFixedText.SetText(aBuf.makeStringAndClear());
}
else
- aFixedText.SetText(String::CreateFromAscii("New Record"));
+ aFixedText.SetText(String(ScResId(STR_NEW_RECORD)));
aSlider.SetThumbPos(aCurrentRow-nStartRow-1);
}
diff --git a/sc/source/ui/src/datafdlg.src b/sc/source/ui/src/datafdlg.src
index 2c07a70..1cb3578 100644
--- a/sc/source/ui/src/datafdlg.src
+++ b/sc/source/ui/src/datafdlg.src
@@ -91,5 +91,9 @@ ModalDialog RID_SCDLG_DATAFORM
HScroll = FALSE ;
TabStop = FALSE ;
};
+ String STR_NEW_RECORD
+ {
+ Text [ en-US ] = "New Record" ;
+ };
};
//end
commit 9e338f0677ab068e1bf792db11123b646938edbc
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Dec 7 17:06:16 2010 -0500
Display correct record information in Data Form dialog. (fdo#32196)
I had accidentally removed the part that constructed correct string
to display. Recovered it, and modified it to use OUStringBuffer
instead of sprintf to construct the string.
Signed-off-by: Norbert Thiebaud <nthiebaud at gmail.com>
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index 377213f..50503e2 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -42,8 +42,12 @@
#include "refundo.hxx"
#include "undodat.hxx"
+#include "rtl/ustrbuf.hxx"
+
#define HDL(hdl) LINK( this, ScDataFormDlg, hdl )
+using ::rtl::OUStringBuffer;
+
//zhangyun
ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShellOri) :
ModalDialog ( pParent, ScResId( RID_SCDLG_DATAFORM ) ),
@@ -272,9 +276,15 @@ void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/)
pEdits[i]->SetText(String());
}
}
- char sRecordStr[256];
- if (aCurrentRow<=nEndRow)
- aFixedText.SetText(String::CreateFromAscii(sRecordStr));
+
+ if (aCurrentRow <= nEndRow)
+ {
+ OUStringBuffer aBuf;
+ aBuf.append(static_cast<sal_Int32>(aCurrentRow - nStartRow));
+ aBuf.appendAscii(" / ");
+ aBuf.append(static_cast<sal_Int32>(nEndRow - nStartRow));
+ aFixedText.SetText(aBuf.makeStringAndClear());
+ }
else
aFixedText.SetText(String::CreateFromAscii("New Record"));
commit 7dc09f19bc5c182ebabb52482db10f828882aad0
Author: Petr Mladek <pmladek at suse.cz>
Date: Wed Dec 1 15:55:50 2010 +0100
Version 3.3.0.1, tag LIBREOFFICE_3_3_0_1 (3.3-rc1)
commit c10648b5aa8b023b6ec3508e8f593c03fb782340
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Nov 30 14:10:25 2010 -0500
Changed header license for new files from ooo-build.
diff --git a/sc/source/ui/inc/cellmergeoption.hxx b/sc/source/ui/inc/cellmergeoption.hxx
index 01fa0eb..ad5fe34 100644
--- a/sc/source/ui/inc/cellmergeoption.hxx
+++ b/sc/source/ui/inc/cellmergeoption.hxx
@@ -1,33 +1,30 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2010 by Novell, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: docfunc.hxx,v $
- * $Revision: 1.18.30.2 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Kohei Yoshida <kyoshida at novell.com> ]
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
#ifndef SC_CELLMERGEOPTION_HXX
#define SC_CELLMERGEOPTION_HXX
diff --git a/sc/source/ui/view/cellmergeoption.cxx b/sc/source/ui/view/cellmergeoption.cxx
index 2352f07..61f2d8b 100644
--- a/sc/source/ui/view/cellmergeoption.cxx
+++ b/sc/source/ui/view/cellmergeoption.cxx
@@ -1,33 +1,30 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
*
- * Copyright 2010 by Novell, Inc.
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
*
- * OpenOffice.org - a multi-platform office productivity suite
+ * The Initial Developer of the Original Code is
+ * [ Kohei Yoshida <kyoshida at novell.com> ]
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
*
- * $RCSfile: docfunc.hxx,v $
- * $Revision: 1.18.30.2 $
+ * Contributor(s):
*
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
#include "cellmergeoption.hxx"
#include "address.hxx"
commit 6683ad4daa97331d1ce06136421cd8ec56190b24
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Nov 30 13:55:00 2010 -0500
Don't forget to store sheet index of merged cell range to be re-merged.
This fixes fdo#31805.
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index be84aa5..abe1c58 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -2200,9 +2200,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
if( !pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
{
- ScCellMergeOption aMergeOption(
- aRange.aStart.Col(), aRange.aStart.Row(),
- aRange.aEnd.Col(), aRange.aEnd.Row() );
+ ScCellMergeOption aMergeOption(aRange);
MergeCells( aMergeOption, FALSE, TRUE, TRUE );
}
qDecreaseRange.pop_back();
diff --git a/sc/source/ui/inc/cellmergeoption.hxx b/sc/source/ui/inc/cellmergeoption.hxx
index 86e2416..01fa0eb 100644
--- a/sc/source/ui/inc/cellmergeoption.hxx
+++ b/sc/source/ui/inc/cellmergeoption.hxx
@@ -48,6 +48,7 @@ struct ScCellMergeOption
bool mbCenter;
explicit ScCellMergeOption();
+ explicit ScCellMergeOption(const ScRange& rRange);
explicit ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow,
bool bCenter = false);
diff --git a/sc/source/ui/view/cellmergeoption.cxx b/sc/source/ui/view/cellmergeoption.cxx
index ff5220e..2352f07 100644
--- a/sc/source/ui/view/cellmergeoption.cxx
+++ b/sc/source/ui/view/cellmergeoption.cxx
@@ -41,6 +41,19 @@ ScCellMergeOption::ScCellMergeOption() :
{
}
+ScCellMergeOption::ScCellMergeOption(const ScRange& rRange) :
+ mnStartCol(rRange.aStart.Col()),
+ mnStartRow(rRange.aStart.Row()),
+ mnEndCol(rRange.aEnd.Col()),
+ mnEndRow(rRange.aEnd.Row()),
+ mbCenter(false)
+{
+ SCTAB nTab1 = rRange.aStart.Tab();
+ SCTAB nTab2 = rRange.aEnd.Tab();
+ for (SCTAB i = nTab1; i <= nTab2; ++i)
+ maTabs.insert(i);
+}
+
ScCellMergeOption::ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bCenter) :
mnStartCol(nStartCol),
mnStartRow(nStartRow),
commit 04608abcf80b8182509a9fc8b5f0d8088c47e045
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Nov 30 00:54:06 2010 -0500
Skip hidden cells while expanding range selection.
This commit happily fixes fdo#31796.
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index b53b3d7..e459c93 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -201,8 +201,8 @@ private:
void GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
SCsCOL& rAreaX, SCsROW& rAreaY, ScFollowMode& rMode);
- void SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nOldY, SCsROW nMovX);
- void SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nOldY, SCsROW nMovY);
+ void SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nMovX);
+ void SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsROW nOldY, SCsROW nMovY);
protected:
void UpdateHeaderWidth( const ScVSplitPos* pWhich = NULL,
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index d875ca7..a42cb46 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -504,7 +504,7 @@ void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode
rMode = eMode;
}
-void ScTabView::SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nOldY, SCsROW nMovX)
+void ScTabView::SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nMovX)
{
ScDocument* pDoc = aViewData.GetDocument();
SCTAB nTab = aViewData.GetTabNo();
@@ -564,7 +564,7 @@ void ScTabView::SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX,
}
}
-void ScTabView::SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nOldY, SCsROW nMovY)
+void ScTabView::SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsROW nOldY, SCsROW nMovY)
{
ScDocument* pDoc = aViewData.GetDocument();
SCTAB nTab = aViewData.GetTabNo();
@@ -640,6 +640,32 @@ bool lcl_isCellQualified(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, b
return true;
}
+void skipHiddenRows(ScDocument* pDoc, SCTAB nTab, SCROW& rRow, bool bForward)
+{
+ SCROW nFirst, nLast;
+ if (!pDoc->RowHidden(rRow, nTab, &nFirst, &nLast))
+ // This row is visible. Nothing to do.
+ return;
+
+ if (bForward)
+ rRow = nLast < MAXROW ? nLast + 1 : MAXROW;
+ else
+ rRow = nFirst > 0 ? nFirst - 1 : 0;
+}
+
+void skipHiddenCols(ScDocument* pDoc, SCTAB nTab, SCCOL& rCol, bool bForward)
+{
+ SCCOL nFirst, nLast;
+ if (!pDoc->ColHidden(rCol, nTab, &nFirst, &nLast))
+ // This row is visible. Nothing to do.
+ return;
+
+ if (bForward)
+ rCol = nLast < MAXCOL ? nLast + 1 : MAXCOL;
+ else
+ rCol = nFirst > 0 ? nFirst - 1 : 0;
+}
+
void lcl_moveCursorByProtRule(
SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, SCTAB nTab, ScDocument* pDoc)
{
@@ -661,6 +687,7 @@ void lcl_moveCursorByProtRule(
if (!lcl_isCellQualified(pDoc, rCol+1, rRow, nTab, bSelectLocked, bSelectUnlocked))
break;
++rCol;
+ skipHiddenCols(pDoc, nTab, rCol, true);
}
}
}
@@ -674,6 +701,7 @@ void lcl_moveCursorByProtRule(
if (!lcl_isCellQualified(pDoc, rCol-1, rRow, nTab, bSelectLocked, bSelectUnlocked))
break;
--rCol;
+ skipHiddenCols(pDoc, nTab, rCol, false);
}
}
}
@@ -687,6 +715,7 @@ void lcl_moveCursorByProtRule(
if (!lcl_isCellQualified(pDoc, rCol, rRow+1, nTab, bSelectLocked, bSelectUnlocked))
break;
++rRow;
+ skipHiddenRows(pDoc, nTab, rRow, true);
}
}
}
@@ -700,6 +729,7 @@ void lcl_moveCursorByProtRule(
if (!lcl_isCellQualified(pDoc, rCol, rRow-1, nTab, bSelectLocked, bSelectUnlocked))
break;
--rRow;
+ skipHiddenRows(pDoc, nTab, rRow, false);
}
}
}
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 8ca6279..d5a6f41 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -984,10 +984,10 @@ void ScTabView::MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
aViewData.ResetOldCursor();
if (nMovX != 0 && VALIDCOLROW(nCurX,nCurY))
- SkipCursorHorizontal(nCurX, nCurY, nOldX, nOldY, nMovX);
+ SkipCursorHorizontal(nCurX, nCurY, nOldX, nMovX);
if (nMovY != 0 && VALIDCOLROW(nCurX,nCurY))
- SkipCursorVertical(nCurX, nCurY, nOldX, nOldY, nMovY);
+ SkipCursorVertical(nCurX, nCurY, nOldY, nMovY);
MoveCursorAbs( nCurX, nCurY, eMode, bShift, FALSE, TRUE, bKeepSel );
}
commit 9938610417b58421ec07386406e0604815c77eaa
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Nov 29 22:27:55 2010 -0500
Extracted methods that may be used in another place.
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 365af2c..b53b3d7 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -201,6 +201,9 @@ private:
void GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
SCsCOL& rAreaX, SCsROW& rAreaY, ScFollowMode& rMode);
+ void SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nOldY, SCsROW nMovX);
+ void SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nOldY, SCsROW nMovY);
+
protected:
void UpdateHeaderWidth( const ScVSplitPos* pWhich = NULL,
const SCROW* pPosY = NULL );
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 6b7671b..d875ca7 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -504,6 +504,126 @@ void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode
rMode = eMode;
}
+void ScTabView::SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nOldY, SCsROW nMovX)
+{
+ ScDocument* pDoc = aViewData.GetDocument();
+ SCTAB nTab = aViewData.GetTabNo();
+
+ bool bSkipProtected = false, bSkipUnprotected = false;
+ ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+ if (pProtect && pProtect->isProtected())
+ {
+ bSkipProtected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
+ bSkipUnprotected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
+ }
+
+ bool bSkipCell = false;
+ bool bHFlip = false;
+ do
+ {
+ SCCOL nLastCol = -1;
+ bSkipCell = pDoc->ColHidden(rCurX, nTab, nLastCol) || pDoc->IsHorOverlapped(rCurX, rCurY, nTab);
+ if (bSkipProtected && !bSkipCell)
+ bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED);
+ if (bSkipUnprotected && !bSkipCell)
+ bSkipCell = !pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED);
+
+ if (bSkipCell)
+ {
+ if (rCurX <= 0 || rCurX >= MAXCOL)
+ {
+ if (bHFlip)
+ {
+ rCurX = nOldX;
+ bSkipCell = false;
+ }
+ else
+ {
+ nMovX = -nMovX;
+ if (nMovX > 0)
+ ++rCurX;
+ else
+ --rCurX;
+ bHFlip = true;
+ }
+ }
+ else
+ if (nMovX > 0)
+ ++rCurX;
+ else
+ --rCurX;
+ }
+ }
+ while (bSkipCell);
+
+ if (pDoc->IsVerOverlapped(rCurX, rCurY, nTab))
+ {
+ aViewData.SetOldCursor(rCurX, rCurY);
+ while (pDoc->IsVerOverlapped(rCurX, rCurY, nTab))
+ --rCurY;
+ }
+}
+
+void ScTabView::SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nOldY, SCsROW nMovY)
+{
+ ScDocument* pDoc = aViewData.GetDocument();
+ SCTAB nTab = aViewData.GetTabNo();
+
+ bool bSkipProtected = false, bSkipUnprotected = false;
+ ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
+ if (pProtect && pProtect->isProtected())
+ {
+ bSkipProtected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
+ bSkipUnprotected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
+ }
+
+ bool bSkipCell = false;
+ bool bVFlip = false;
+ do
+ {
+ SCROW nLastRow = -1;
+ bSkipCell = pDoc->RowHidden(rCurY, nTab, nLastRow) || pDoc->IsVerOverlapped( rCurX, rCurY, nTab );
+ if (bSkipProtected && !bSkipCell)
+ bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED);
+ if (bSkipUnprotected && !bSkipCell)
+ bSkipCell = !pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED);
+
+ if (bSkipCell)
+ {
+ if (rCurY <= 0 || rCurY >= MAXROW)
+ {
+ if (bVFlip)
+ {
+ rCurY = nOldY;
+ bSkipCell = false;
+ }
+ else
+ {
+ nMovY = -nMovY;
+ if (nMovY > 0)
+ ++rCurY;
+ else
+ --rCurY;
+ bVFlip = true;
+ }
+ }
+ else
+ if (nMovY > 0)
+ ++rCurY;
+ else
+ --rCurY;
+ }
+ }
+ while (bSkipCell);
+
+ if (pDoc->IsHorOverlapped(rCurX, rCurY, nTab))
+ {
+ aViewData.SetOldCursor(rCurX, rCurY);
+ while (pDoc->IsHorOverlapped(rCurX, rCurY, nTab))
+ --rCurX;
+ }
+}
+
namespace {
bool lcl_isCellQualified(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, bool bSelectLocked, bool bSelectUnlocked)
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index fdccb1a..8ca6279 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -984,88 +984,10 @@ void ScTabView::MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode,
aViewData.ResetOldCursor();
if (nMovX != 0 && VALIDCOLROW(nCurX,nCurY))
- {
- BOOL bHFlip = FALSE;
- do
- {
- SCCOL nLastCol = -1;
- bSkipCell = pDoc->ColHidden(nCurX, nTab, nLastCol) || pDoc->IsHorOverlapped( nCurX, nCurY, nTab );
- if (bSkipProtected && !bSkipCell)
- bSkipCell = pDoc->HasAttrib(nCurX, nCurY, nTab, nCurX, nCurY, nTab, HASATTR_PROTECTED);
- if (bSkipUnprotected && !bSkipCell)
- bSkipCell = !pDoc->HasAttrib(nCurX, nCurY, nTab, nCurX, nCurY, nTab, HASATTR_PROTECTED);
-
- if (bSkipCell)
- {
- if ( nCurX<=0 || nCurX>=MAXCOL )
- {
- if (bHFlip)
- {
- nCurX = nOldX;
- bSkipCell = FALSE;
- }
- else
- {
- nMovX = -nMovX;
- if (nMovX > 0) ++nCurX; else --nCurX; // zuruecknehmen
- bHFlip = TRUE;
- }
- }
- else
- if (nMovX > 0) ++nCurX; else --nCurX;
- }
- }
- while (bSkipCell);
-
- if (pDoc->IsVerOverlapped( nCurX, nCurY, nTab ))
- {
- aViewData.SetOldCursor( nCurX,nCurY );
- while (pDoc->IsVerOverlapped( nCurX, nCurY, nTab ))
- --nCurY;
- }
- }
+ SkipCursorHorizontal(nCurX, nCurY, nOldX, nOldY, nMovX);
if (nMovY != 0 && VALIDCOLROW(nCurX,nCurY))
- {
- BOOL bVFlip = FALSE;
- do
- {
- SCROW nLastRow = -1;
- bSkipCell = pDoc->RowHidden(nCurY, nTab, nLastRow) || pDoc->IsVerOverlapped( nCurX, nCurY, nTab );
- if (bSkipProtected && !bSkipCell)
- bSkipCell = pDoc->HasAttrib(nCurX, nCurY, nTab, nCurX, nCurY, nTab, HASATTR_PROTECTED);
- if (bSkipUnprotected && !bSkipCell)
- bSkipCell = !pDoc->HasAttrib(nCurX, nCurY, nTab, nCurX, nCurY, nTab, HASATTR_PROTECTED);
-
- if (bSkipCell)
- {
- if ( nCurY<=0 || nCurY>=MAXROW )
- {
- if (bVFlip)
- {
- nCurY = nOldY;
- bSkipCell = FALSE;
- }
- else
- {
- nMovY = -nMovY;
- if (nMovY > 0) ++nCurY; else --nCurY; // zuruecknehmen
- bVFlip = TRUE;
- }
- }
- else
- if (nMovY > 0) ++nCurY; else --nCurY;
- }
- }
- while (bSkipCell);
-
- if (pDoc->IsHorOverlapped( nCurX, nCurY, nTab ))
- {
- aViewData.SetOldCursor( nCurX,nCurY );
- while (pDoc->IsHorOverlapped( nCurX, nCurY, nTab ))
- --nCurX;
- }
- }
+ SkipCursorVertical(nCurX, nCurY, nOldX, nOldY, nMovY);
MoveCursorAbs( nCurX, nCurY, eMode, bShift, FALSE, TRUE, bKeepSel );
}
commit cbdf7c36bd1128757d4e30d52976717d4ca67b8d
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Nov 29 20:36:22 2010 -0500
Removed unused code.
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index f995cb2..fb5158a 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -596,12 +596,6 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
aOutputData.SetEditCell( nEditCol, nEditRow );
else
bEditMode = FALSE;
-
- // nur Edit-Area zu zeichnen?
- //! dann muss trotzdem noch der Rand / das Gitter gemalt werden!
-
-// if ( nEditCol <= nX1 && nEditEndCol >= nX2 && nEditRow <= nY1 && nEditEndRow >= nY2 )
-// bOnlyEdit = TRUE;
}
// define drawing layer map mode and paint rectangle
commit d8e814b2b0966efb1cc40223bd0025c96b1d825e
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Nov 29 19:54:35 2010 -0500
Don't update visible ranges for invisible panes.
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 7420db5..d465f80 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1695,7 +1695,7 @@ void ScTabView::UpdateVisibleRange()
{
for (int i = 0; i < 4; ++i)
{
- if (!pGridWin[i])
+ if (!pGridWin[i] || !pGridWin[i]->IsVisible())
continue;
pGridWin[i]->UpdateVisibleRange();
commit 052488532d2237ea12a6cfd72d6e38350e5ae122
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Nov 29 19:20:22 2010 -0500
Re-calculate visible range when switching sheets.
Visible range of the current sheet is used to decide whether or not
to render cell cursor. Failing to do that was causing the cursor
to disappear when switching sheets while the cursor on the current
sheet was invisible. (fdo#31753)
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index a2e6637..4bd6ced 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -394,6 +394,7 @@ public:
void CheckNeedsRepaint();
void UpdateDPFromFieldPopupMenu();
+ void UpdateVisibleRange();
// #114409#
void CursorChanged();
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 7cde207..365af2c 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -210,6 +210,7 @@ protected:
void ZoomChanged();
void UpdateShow();
+ void UpdateVisibleRange();
void GetBorderSize( SvBorder& rBorder, const Size& rSize );
void ResetDrawDragMode();
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 6f9f306..ccacee3 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -594,6 +594,22 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
aFunc.DataPilotUpdate(pDPObj, &aNewDPObj, true, false);
}
+void ScGridWindow::UpdateVisibleRange()
+{
+ SCCOL nPosX = pViewData->GetPosX(eHWhich);
+ SCROW nPosY = pViewData->GetPosY(eVWhich);
+ SCCOL nXRight = nPosX + pViewData->VisibleCellsX(eHWhich);
+ if (nXRight > MAXCOL) nXRight = MAXCOL;
+ SCROW nYBottom = nPosY + pViewData->VisibleCellsY(eVWhich);
+ if (nYBottom > MAXROW) nYBottom = MAXROW;
+
+ // Store the current visible range.
+ maVisibleRange.mnCol1 = nPosX;
+ maVisibleRange.mnCol2 = nXRight;
+ maVisibleRange.mnRow1 = nPosY;
+ maVisibleRange.mnRow2 = nYBottom;
+}
+
void ScGridWindow::DPMouseMove( const MouseEvent& rMEvt )
{
DPTestMouse( rMEvt, TRUE );
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index e4760fb..f995cb2 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -422,7 +422,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
{
ScModule* pScMod = SC_MOD();
BOOL bTextWysiwyg = pScMod->GetInputOptions().GetTextWysiwyg();
- BOOL bGridFirst = TRUE; //! entscheiden!!!
+ BOOL bGridFirst = TRUE; //! entscheiden!!!
if (pViewData->IsMinimized())
return;
@@ -432,36 +432,30 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
DBG_ASSERT( ValidCol(nX2) && ValidRow(nY2), "GridWin Draw Bereich zu gross" );
- SCCOL nPosX = pViewData->GetPosX( eHWhich );
- SCROW nPosY = pViewData->GetPosY( eVWhich );
- if (nX2 < nPosX || nY2 < nPosY)
- return; // unsichtbar
- if (nX1 < nPosX) nX1 = nPosX;
- if (nY1 < nPosY) nY1 = nPosY;
+ UpdateVisibleRange();
- SCCOL nXRight = nPosX + pViewData->VisibleCellsX(eHWhich);
- if (nXRight > MAXCOL) nXRight = MAXCOL;
- SCROW nYBottom = nPosY + pViewData->VisibleCellsY(eVWhich);
- if (nYBottom > MAXROW) nYBottom = MAXROW;
+ if (nX2 < maVisibleRange.mnCol1 || nY2 < maVisibleRange.mnRow1)
+ return;
+ // unsichtbar
+ if (nX1 < maVisibleRange.mnCol1)
+ nX1 = maVisibleRange.mnCol1;
+ if (nY1 < maVisibleRange.mnRow1)
+ nY1 = maVisibleRange.mnRow1;
- // Store the current visible range.
- maVisibleRange.mnCol1 = nPosX;
- maVisibleRange.mnCol2 = nXRight;
- maVisibleRange.mnRow1 = nPosY;
- maVisibleRange.mnRow2 = nYBottom;
+ if (nX1 > maVisibleRange.mnCol2 || nY1 > maVisibleRange.mnRow2)
+ return;
- if (nX1 > nXRight || nY1 > nYBottom)
- return; // unsichtbar
- if (nX2 > nXRight) nX2 = nXRight;
- if (nY2 > nYBottom) nY2 = nYBottom;
+ if (nX2 > maVisibleRange.mnCol2)
+ nX2 = maVisibleRange.mnCol2;
+ if (nY2 > maVisibleRange.mnRow2)
+ nY2 = maVisibleRange.mnRow2;
- if ( eMode != SC_UPDATE_MARKS )
- if (nX2 < nXRight)
- nX2 = nXRight; // zum Weiterzeichnen
+ if ( eMode != SC_UPDATE_MARKS && nX2 < maVisibleRange.mnCol2)
+ nX2 = maVisibleRange.mnCol2; // zum Weiterzeichnen
- // ab hier kein return mehr
+ // ab hier kein return mehr
- ++nPaintCount; // merken, dass gemalt wird (wichtig beim Invertieren)
+ ++nPaintCount; // merken, dass gemalt wird (wichtig beim Invertieren)
ScDocShell* pDocSh = pViewData->GetDocShell();
ScDocument* pDoc = pDocSh->GetDocument();
@@ -475,7 +469,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
long nLayoutSign = bLayoutRTL ? -1 : 1;
if ( bLayoutRTL )
{
- long nEndPixel = pViewData->GetScrPos( nX2+1, nPosY, eWhich ).X();
+ long nEndPixel = pViewData->GetScrPos( nX2+1, maVisibleRange.mnRow1, eWhich ).X();
nMirrorWidth = aScrPos.X() - nEndPixel;
aScrPos.X() = nEndPixel + 1;
}
@@ -491,7 +485,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
BOOL bCurVis = nCursorHideCount==0 &&
( nCurEndX+1 >= nX1 && nCurX <= nX2+1 && nCurEndY+1 >= nY1 && nCurY <= nY2+1 );
- // AutoFill-Anfasser
+ // AutoFill-Anfasser
if ( !bCurVis && nCursorHideCount==0 && bAutoMarkVisible && aAutoMarkPos.Tab() == nTab &&
( aAutoMarkPos.Col() != nCurX || aAutoMarkPos.Row() != nCurY ) )
{
@@ -499,9 +493,9 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
SCROW nHdlY = aAutoMarkPos.Row();
pDoc->ExtendMerge( nHdlX, nHdlY, nHdlX, nHdlY, nTab );
bCurVis = ( nHdlX+1 >= nX1 && nHdlX <= nX2 && nHdlY+1 >= nY1 && nHdlY <= nY2 );
- // links und oben ist nicht betroffen
+ // links und oben ist nicht betroffen
- //! AutoFill-Anfasser alleine (ohne Cursor) zeichnen ???
+ //! AutoFill-Anfasser alleine (ohne Cursor) zeichnen ???
}
double nPPTX = pViewData->GetPPTX();
@@ -526,14 +520,14 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
nScrX, nScrY, nX1, nY1, nX2, nY2, nPPTX, nPPTY,
&aZoomX, &aZoomY );
- aOutputData.SetMirrorWidth( nMirrorWidth ); // needed for RTL
+ aOutputData.SetMirrorWidth( nMirrorWidth ); // needed for RTL
std::auto_ptr< VirtualDevice > xFmtVirtDev;
BOOL bLogicText = bTextWysiwyg; // call DrawStrings in logic MapMode?
if ( bTextWysiwyg )
{
- // use printer for text formatting
+ // use printer for text formatting
OutputDevice* pFmtDev = pDoc->GetPrinter();
pFmtDev->SetMapMode( pViewData->GetLogicMode(eWhich) );
@@ -555,18 +549,18 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
Color aGridColor( rColorCfg.GetColorValue( svtools::CALCGRID, FALSE ).nColor );
if ( aGridColor.GetColor() == COL_TRANSPARENT )
{
- // use view options' grid color only if color config has "automatic" color
+ // use view options' grid color only if color config has "automatic" color
aGridColor = rOpts.GetGridColor();
}
- aOutputData.SetSyntaxMode ( pViewData->IsSyntaxMode() );
- aOutputData.SetGridColor ( aGridColor );
- aOutputData.SetShowNullValues ( rOpts.GetOption( VOPT_NULLVALS ) );
- aOutputData.SetShowFormulas ( bFormulaMode );
+ aOutputData.SetSyntaxMode ( pViewData->IsSyntaxMode() );
+ aOutputData.SetGridColor ( aGridColor );
+ aOutputData.SetShowNullValues ( rOpts.GetOption( VOPT_NULLVALS ) );
+ aOutputData.SetShowFormulas ( bFormulaMode );
aOutputData.SetShowSpellErrors ( pDoc->GetDocOptions().IsAutoSpell() );
- aOutputData.SetMarkClipped ( bMarkClipped );
+ aOutputData.SetMarkClipped ( bMarkClipped );
- aOutputData.SetUseStyleColor( TRUE ); // always set in table view
+ aOutputData.SetUseStyleColor( TRUE ); // always set in table view
aOutputData.SetEditObject( GetEditObject() );
aOutputData.SetViewShell( pViewData->GetViewShell() );
@@ -582,14 +576,14 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
}
BOOL bPageMode = pViewData->IsPagebreakMode();
- if (bPageMode) // nach FindChanged
+ if (bPageMode) // nach FindChanged
{
// SetPagebreakMode initialisiert auch bPrinted Flags
aOutputData.SetPagebreakMode( pViewData->GetView()->GetPageBreakData() );
}
- EditView* pEditView = NULL;
- BOOL bEditMode = pViewData->HasEditView(eWhich);
+ EditView* pEditView = NULL;
+ BOOL bEditMode = pViewData->HasEditView(eWhich);
if ( bEditMode && pViewData->GetRefTabNo() == nTab )
{
SCCOL nEditCol;
@@ -603,11 +597,11 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
else
bEditMode = FALSE;
- // nur Edit-Area zu zeichnen?
- //! dann muss trotzdem noch der Rand / das Gitter gemalt werden!
+ // nur Edit-Area zu zeichnen?
+ //! dann muss trotzdem noch der Rand / das Gitter gemalt werden!
-// if ( nEditCol <= nX1 && nEditEndCol >= nX2 && nEditRow <= nY1 && nEditEndRow >= nY2 )
-// bOnlyEdit = TRUE;
+// if ( nEditCol <= nX1 && nEditEndCol >= nX2 && nEditRow <= nY1 && nEditEndRow >= nY2 )
+// bOnlyEdit = TRUE;
}
// define drawing layer map mode and paint rectangle
@@ -642,7 +636,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
}
OutputDevice* pContentDev = this; // device for document content, used by overlay manager
- SdrPaintWindow* pTargetPaintWindow = 0; // #i74769# work with SdrPaintWindow directly
+ SdrPaintWindow* pTargetPaintWindow = 0; // #i74769# work with SdrPaintWindow directly
{
// init redraw
@@ -671,7 +665,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
}
}
- // Rand (Wiese) (Pixel)
+ // Rand (Wiese) (Pixel)
if ( nX2==MAXCOL || nY2==MAXROW )
{
// save MapMode and set to pixel
@@ -741,7 +735,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
aOutputData.DrawShadow();
aOutputData.DrawFrame();
if ( !bLogicText )
- aOutputData.DrawStrings(FALSE); // in pixel MapMode
+ aOutputData.DrawStrings(FALSE); // in pixel MapMode
// edit cells and printer-metrics text must be before the buttons
// (DataPilot buttons contain labels in UI font)
@@ -767,10 +761,10 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
}
aOutputData.DrawClipMarks();
- // Szenario / ChangeTracking muss auf jeden Fall nach DrawGrid sein, auch bei !bGridFirst
+ // Szenario / ChangeTracking muss auf jeden Fall nach DrawGrid sein, auch bei !bGridFirst
- //! Test, ob ChangeTrack-Anzeige aktiv ist
- //! Szenario-Rahmen per View-Optionen abschaltbar?
+ //! Test, ob ChangeTrack-Anzeige aktiv ist
+ //! Szenario-Rahmen per View-Optionen abschaltbar?
SCTAB nTabCount = pDoc->GetTableCount();
ScHighlightRanges* pHigh = pViewData->GetView()->GetHighlightRanges();
@@ -809,7 +803,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
DrawRedraw( aOutputData, eMode, SC_LAYER_INTERN );
DrawSdrGrid( aDrawingRectLogic, pContentDev );
- if (!bIsInScroll) // Drawing Markierungen
+ if (!bIsInScroll) // Drawing Markierungen
{
if(eMode == SC_UPDATE_CHANGED && aOutputData.SetChangedClip())
{
@@ -832,7 +826,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
aRefColor, FALSE );
}
- // Range-Finder
+ // Range-Finder
ScInputHandler* pHdl = pScMod->GetInputHdl( pViewData->GetViewShell() );
if (pHdl)
@@ -879,7 +873,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
}
}
- // InPlace Edit-View
+ // InPlace Edit-View
// moved after EndDrawLayers() to get it outside the overlay buffer and
// on top of everything
if ( bEditMode && (pViewData->GetRefTabNo() == pViewData->GetTabNo()) )
@@ -894,7 +888,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
SetFillColor( pEditView->GetBackgroundColor() );
Point aStart = pViewData->GetScrPos( nCol1, nRow1, eWhich );
Point aEnd = pViewData->GetScrPos( nCol2+1, nRow2+1, eWhich );
- aEnd.X() -= 2 * nLayoutSign; // don't overwrite grid
+ aEnd.X() -= 2 * nLayoutSign; // don't overwrite grid
aEnd.Y() -= 2;
DrawRect( Rectangle( aStart,aEnd ) );
@@ -916,11 +910,11 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
SetMapMode(aDrawMode);
if ( pNoteMarker )
- pNoteMarker->Draw(); // ueber den Cursor, im Drawing-MapMode
+ pNoteMarker->Draw(); // ueber den Cursor, im Drawing-MapMode
//
- // Wenn waehrend des Paint etwas invertiert wurde (Selektion geaendert aus Basic-Macro),
- // ist das jetzt durcheinandergekommen und es muss neu gemalt werden
+ // Wenn waehrend des Paint etwas invertiert wurde (Selektion geaendert aus Basic-Macro),
+ // ist das jetzt durcheinandergekommen und es muss neu gemalt werden
//
DBG_ASSERT(nPaintCount, "nPaintCount falsch");
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 365ed2d..7420db5 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1691,6 +1691,17 @@ void ScTabView::UpdateShow()
//! neue Gridwindows eintragen
}
+void ScTabView::UpdateVisibleRange()
+{
+ for (int i = 0; i < 4; ++i)
+ {
+ if (!pGridWin[i])
+ continue;
+
+ pGridWin[i]->UpdateVisibleRange();
+ }
+}
+
// --- Splitter --------------------------------------------------------
IMPL_LINK( ScTabView, SplitHdl, Splitter*, pSplitter )
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 5f13e02..fdccb1a 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1638,13 +1638,13 @@ void ScTabView::SetTabNo( SCTAB nTab, BOOL bNew, BOOL bExtendSelection )
if ( bRefMode ) // hide EditView if necessary (after aViewData.SetTabNo !)
{
- for ( USHORT i=0; i<4; i++ )
- if ( pGridWin[i] )
- if ( pGridWin[i]->IsVisible() )
- pGridWin[i]->UpdateEditViewPos();
+ for (USHORT i = 0; i < 4; ++i)
+ if (pGridWin[i] && pGridWin[i]->IsVisible())
+ pGridWin[i]->UpdateEditViewPos();
}
TabChanged(); // DrawView
+ UpdateVisibleRange();
aViewData.GetViewShell()->WindowChanged(); // falls das aktive Fenster anders ist
if ( !bUnoRefDialog )
commit 42485a770ac22f501b6bf6e94215dd42d267c48f
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Nov 29 16:07:40 2010 -0500
Fixed use of incorrect integer type during import of outlines.
I was supposed to use SCSIZE to store column / row position but was
incorrectly using sal_uInt8. This caused import of outlines from
Excel document to entirely get screwed when the outline positions
were > 255, and it was understandably so. :-P (fdo#31833)
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list