Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
1097d2f3
Kaydet (Commit)
1097d2f3
authored
Mar 23, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Some misc changes & some dumping facility for pivot table for debugging.
üst
16cfcce0
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
124 additions
and
16 deletions
+124
-16
dpcache.hxx
sc/inc/dpcache.hxx
+5
-0
dpitemdata.hxx
sc/inc/dpitemdata.hxx
+2
-3
dpmacros.hxx
sc/inc/dpmacros.hxx
+36
-0
dpobject.hxx
sc/inc/dpobject.hxx
+6
-0
dpcache.cxx
sc/source/core/data/dpcache.cxx
+47
-0
dpitemdata.cxx
sc/source/core/data/dpitemdata.cxx
+1
-1
dpobject.cxx
sc/source/core/data/dpobject.cxx
+14
-0
dbdocfun.cxx
sc/source/ui/docshell/dbdocfun.cxx
+1
-4
dbfunc.hxx
sc/source/ui/inc/dbfunc.hxx
+4
-2
dbfunc3.cxx
sc/source/ui/view/dbfunc3.cxx
+7
-6
gridwin2.cxx
sc/source/ui/view/gridwin2.cxx
+1
-0
No files found.
sc/inc/dpcache.hxx
Dosyayı görüntüle @
1097d2f3
...
...
@@ -31,6 +31,7 @@
#include "global.hxx"
#include "dpnumgroupinfo.hxx"
#include "dpmacros.hxx"
#include "tools/date.hxx"
#include <boost/noncopyable.hpp>
...
...
@@ -160,6 +161,10 @@ public:
ScDPCache
(
ScDocument
*
pDoc
);
~
ScDPCache
();
#if DEBUG_PIVOT_TABLE
void
Dump
()
const
;
#endif
private
:
void
PostInit
();
void
Clear
();
...
...
sc/inc/dpitemdata.hxx
Dosyayı görüntüle @
1097d2f3
...
...
@@ -35,13 +35,12 @@
#include "sal/types.h"
#include "tools/solar.h"
#include "rtl/ustring.hxx"
#include "dpmacros.hxx"
#include <vector>
#include <boost/unordered_map.hpp>
#define DEBUG_DP_ITEM_DATA 0
class
ScDocument
;
/**
...
...
@@ -119,7 +118,7 @@ public:
sal_uInt8
GetCellType
()
const
;
#if DEBUG_
DP_ITEM_DATA
#if DEBUG_
PIVOT_TABLE
void
Dump
(
const
char
*
msg
)
const
;
#endif
};
...
...
sc/inc/dpmacros.hxx
0 → 100644
Dosyayı görüntüle @
1097d2f3
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 or as specified alternatively below. 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.
*
* Major Contributor(s):
* Copyright (C) 2012 Kohei Yoshida <kohei.yoshida@suse.com>
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* 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_DPMACROS_HXX__
#define __SC_DPMACROS_HXX__
#define DEBUG_PIVOT_TABLE 0
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/inc/dpobject.hxx
Dosyayı görüntüle @
1097d2f3
...
...
@@ -35,6 +35,8 @@
#include "dpoutput.hxx"
#include "dptypes.hxx"
#include "pivot.hxx"
#include "dpmacros.hxx"
#include <com/sun/star/sheet/XDimensionsSupplier.hpp>
#include <set>
...
...
@@ -259,6 +261,10 @@ public:
std
::
vector
<
PivotField
>*
pRefPageFields
=
NULL
);
static
bool
IsOrientationAllowed
(
sal_uInt16
nOrient
,
sal_Int32
nDimFlags
);
#if DEBUG_PIVOT_TABLE
void
DumpCache
()
const
;
#endif
};
...
...
sc/source/core/data/dpcache.cxx
Dosyayı görüntüle @
1097d2f3
...
...
@@ -1126,4 +1126,51 @@ long ScDPCache::GetColumnCount() const
return
mnColumnCount
;
}
#if DEBUG_PIVOT_TABLE
#include <iostream>
using
std
::
cout
;
using
std
::
endl
;
namespace
{
std
::
ostream
&
operator
<<
(
::
std
::
ostream
&
os
,
const
rtl
::
OUString
&
str
)
{
return
os
<<
::
rtl
::
OUStringToOString
(
str
,
RTL_TEXTENCODING_UTF8
).
getStr
();
}
}
void
ScDPCache
::
Dump
()
const
{
cout
<<
"--- pivot cache dump"
<<
endl
;
{
FieldsType
::
const_iterator
it
=
maFields
.
begin
(),
itEnd
=
maFields
.
end
();
for
(
size_t
i
=
0
;
it
!=
itEnd
;
++
it
,
++
i
)
{
const
Field
&
fld
=
*
it
;
cout
<<
"* source field: "
<<
GetDimensionName
(
i
)
<<
endl
;
cout
<<
" item count: "
<<
fld
.
maItems
.
size
()
<<
endl
;
if
(
fld
.
mpGroup
)
{
cout
<<
" group item count: "
<<
fld
.
mpGroup
->
maItems
.
size
()
<<
endl
;
}
}
}
{
GroupFieldsType
::
const_iterator
it
=
maGroupFields
.
begin
(),
itEnd
=
maGroupFields
.
end
();
for
(;
it
!=
itEnd
;
++
it
)
{
const
GroupItems
&
gi
=
*
it
;
cout
<<
"* group field: (unnamed)"
<<
endl
;
cout
<<
" item count: "
<<
gi
.
maItems
.
size
()
<<
endl
;
}
}
cout
<<
"---"
<<
endl
;
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/core/data/dpitemdata.cxx
Dosyayı görüntüle @
1097d2f3
...
...
@@ -294,7 +294,7 @@ sal_uInt8 ScDPItemData::GetCellType() const
return
SC_VALTYPE_STRING
;
}
#if DEBUG_
DP_ITEM_DATA
#if DEBUG_
PIVOT_TABLE
void
ScDPItemData
::
Dump
(
const
char
*
msg
)
const
{
printf
(
"--- (%s)
\n
"
,
msg
);
...
...
sc/source/core/data/dpobject.cxx
Dosyayı görüntüle @
1097d2f3
...
...
@@ -2524,6 +2524,20 @@ uno::Reference<sheet::XDimensionsSupplier> ScDPObject::CreateSource( const ScDPS
return
xRet
;
}
#if DEBUG_PIVOT_TABLE
void
ScDPObject
::
DumpCache
()
const
{
if
(
!
mpTableData
)
return
;
const
ScDPCache
*
pCache
=
mpTableData
->
GetCacheTable
().
getCache
();
if
(
!
pCache
)
return
;
pCache
->
Dump
();
}
#endif
ScDPCollection
::
SheetCaches
::
SheetCaches
(
ScDocument
*
pDoc
)
:
mpDoc
(
pDoc
)
{}
namespace
{
...
...
sc/source/ui/docshell/dbdocfun.cxx
Dosyayı görüntüle @
1097d2f3
...
...
@@ -1327,9 +1327,6 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
if
(
pNewObj
==
pOldObj
&&
pDestObj
->
IsImportData
()
)
pDestObj
->
ClearTableData
();
if
(
pDestObj
->
HasGroups
())
pDestObj
->
ReloadGroupTableData
();
pDestObj
->
InvalidateData
();
// before getting the new output area
// make sure the table has a name (not set by dialog)
...
...
@@ -1479,7 +1476,7 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* pDPObj, bool bApi)
ScDPObject
*
pObj
=
*
it
;
if
(
bHasGroups
)
// Re-build table data for each pivot table when the original contains group fields.
pObj
->
Clear
TableData
();
pObj
->
ReloadGroup
TableData
();
// This action is intentionally not undoable since it modifies cache.
DataPilotUpdate
(
pObj
,
pObj
,
false
,
bApi
);
...
...
sc/source/ui/inc/dbfunc.hxx
Dosyayı görüntüle @
1097d2f3
...
...
@@ -85,8 +85,10 @@ public:
void
Consolidate
(
const
ScConsolidateParam
&
rParam
,
sal_Bool
bRecord
=
sal_True
);
bool
MakePivotTable
(
const
ScDPSaveData
&
rData
,
const
ScRange
&
rDest
,
sal_Bool
bNewTable
,
const
ScDPObject
&
rSource
,
sal_Bool
bApi
=
false
);
bool
MakePivotTable
(
const
ScDPSaveData
&
rData
,
const
ScRange
&
rDest
,
bool
bNewTable
,
const
ScDPObject
&
rSource
,
bool
bApi
=
false
);
void
DeletePivotTable
();
void
RecalcPivotTable
();
bool
HasSelectionForDateGroup
(
ScDPNumGroupInfo
&
rOldInfo
,
sal_Int32
&
rParts
);
...
...
sc/source/ui/view/dbfunc3.cxx
Dosyayı görüntüle @
1097d2f3
...
...
@@ -591,8 +591,9 @@ String lcl_MakePivotTabName( const String& rPrefix, SCTAB nNumber )
return
aName
;
}
bool
ScDBFunc
::
MakePivotTable
(
const
ScDPSaveData
&
rData
,
const
ScRange
&
rDest
,
sal_Bool
bNewTable
,
const
ScDPObject
&
rSource
,
sal_Bool
bApi
)
bool
ScDBFunc
::
MakePivotTable
(
const
ScDPSaveData
&
rData
,
const
ScRange
&
rDest
,
bool
bNewTable
,
const
ScDPObject
&
rSource
,
bool
bApi
)
{
// error message if no fields are set
// this must be removed when drag&drop of fields from a toolbox is available
...
...
@@ -605,7 +606,7 @@ bool ScDBFunc::MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest,
ScDocShell
*
pDocSh
=
GetViewData
()
->
GetDocShell
();
ScDocument
*
pDoc
=
GetViewData
()
->
GetDocument
();
sal_Bool
bUndo
(
pDoc
->
IsUndoEnabled
()
);
bool
bUndo
=
pDoc
->
IsUndoEnabled
(
);
ScRange
aDestRange
=
rDest
;
if
(
bNewTable
)
...
...
@@ -626,7 +627,7 @@ bool ScDBFunc::MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest,
while
(
!
pDoc
->
InsertTab
(
nNewTab
,
lcl_MakePivotTabName
(
aName
,
i
)
)
&&
i
<=
MAXTAB
)
i
++
;
sal_B
ool
bAppend
=
(
nNewTab
+
1
==
pDoc
->
GetTableCount
()
);
b
ool
bAppend
=
(
nNewTab
+
1
==
pDoc
->
GetTableCount
()
);
if
(
bUndo
)
{
pDocSh
->
GetUndoManager
()
->
AddUndoAction
(
...
...
@@ -634,7 +635,7 @@ bool ScDBFunc::MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest,
}
GetViewData
()
->
InsertTab
(
nNewTab
);
SetTabNo
(
nNewTab
,
sal_True
);
SetTabNo
(
nNewTab
,
true
);
aDestRange
=
ScRange
(
0
,
0
,
nNewTab
);
}
...
...
@@ -664,7 +665,7 @@ bool ScDBFunc::MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest,
bool
bAllowMove
=
(
pDPObj
!=
NULL
);
// allow re-positioning when editing existing table
ScDBDocFunc
aFunc
(
*
pDocSh
);
bool
bSuccess
=
aFunc
.
DataPilotUpdate
(
pDPObj
,
&
aObj
,
sal_True
,
false
,
bAllowMove
);
bool
bSuccess
=
aFunc
.
DataPilotUpdate
(
pDPObj
,
&
aObj
,
true
,
false
,
bAllowMove
);
CursorPosChanged
();
// shells may be switched
...
...
sc/source/ui/view/gridwin2.cxx
Dosyayı görüntüle @
1097d2f3
...
...
@@ -599,6 +599,7 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
}
pDim
->
UpdateMemberVisibility
(
aResult
);
pDPObj
->
ReloadGroupTableData
();
ScDBDocFunc
aFunc
(
*
pViewData
->
GetDocShell
());
aFunc
.
DataPilotUpdate
(
pDPObj
,
pDPObj
,
true
,
false
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment