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
5ce6a22a
Kaydet (Commit)
5ce6a22a
authored
Eki 10, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make this loop a bit easier to follow...
Change-Id: Ib978f47925e1f7d77e02586bff50d24fa5b27f2c
üst
424fb26d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
38 deletions
+69
-38
ChartView.cxx
chart2/source/view/main/ChartView.cxx
+69
-38
No files found.
chart2/source/view/main/ChartView.cxx
Dosyayı görüntüle @
5ce6a22a
...
@@ -242,6 +242,9 @@ public:
...
@@ -242,6 +242,9 @@ public:
void
AdaptScaleOfYAxisWithoutAttachedSeries
(
ChartModel
&
rModel
);
void
AdaptScaleOfYAxisWithoutAttachedSeries
(
ChartModel
&
rModel
);
bool
isCategoryPositionShifted
(
const
chart2
::
ScaleData
&
rSourceScale
,
bool
bHasComplexCategories
)
const
;
private
:
private
:
SeriesPlottersType
m_aSeriesPlotterList
;
SeriesPlottersType
m_aSeriesPlotterList
;
std
::
vector
<
VCoordinateSystem
*
>&
m_rVCooSysList
;
std
::
vector
<
VCoordinateSystem
*
>&
m_rVCooSysList
;
...
@@ -525,61 +528,89 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
...
@@ -525,61 +528,89 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
}
}
}
}
bool
SeriesPlotterContainer
::
isCategoryPositionShifted
(
const
chart2
::
ScaleData
&
rSourceScale
,
bool
bHasComplexCategories
)
const
{
if
(
rSourceScale
.
AxisType
==
AxisType
::
CATEGORY
&&
m_bChartTypeUsesShiftedCategoryPositionPerDefault
)
return
true
;
if
(
rSourceScale
.
AxisType
==
AxisType
::
CATEGORY
&&
bHasComplexCategories
)
return
true
;
if
(
rSourceScale
.
AxisType
==
AxisType
::
DATE
)
return
true
;
if
(
rSourceScale
.
AxisType
==
AxisType
::
SERIES
)
return
true
;
return
false
;
}
void
SeriesPlotterContainer
::
initAxisUsageList
(
const
Date
&
rNullDate
)
void
SeriesPlotterContainer
::
initAxisUsageList
(
const
Date
&
rNullDate
)
{
{
m_aAxisUsageList
.
clear
();
m_aAxisUsageList
.
clear
();
size_t
nC
;
for
(
nC
=
0
;
nC
<
m_rVCooSysList
.
size
();
nC
++
)
// Loop through coordinate systems in the diagram (though for now
// there should only be one coordinate system per diagram).
for
(
size_t
i
=
0
,
n
=
m_rVCooSysList
.
size
();
i
<
n
;
++
i
)
{
{
VCoordinateSystem
*
pVCooSys
=
m_rVCooSysList
[
nC
];
VCoordinateSystem
*
pVCooSys
=
m_rVCooSysList
[
i
];
for
(
sal_Int32
nDimensionIndex
=
0
;
nDimensionIndex
<
3
;
nDimensionIndex
++
)
uno
::
Reference
<
XCoordinateSystem
>
xCooSys
=
pVCooSys
->
getModel
();
sal_Int32
nDimCount
=
xCooSys
->
getDimension
();
for
(
sal_Int32
nDimIndex
=
0
;
nDimIndex
<
nDimCount
;
++
nDimIndex
)
{
{
uno
::
Reference
<
XCoordinateSystem
>
xCooSys
=
pVCooSys
->
getModel
();
bool
bDateAxisAllowed
=
ChartTypeHelper
::
isSupportingDateAxis
(
sal_Int32
nDimensionCount
=
xCooSys
->
getDimension
();
AxisHelper
::
getChartTypeByIndex
(
xCooSys
,
0
),
nDimCount
,
nDimIndex
);
if
(
nDimensionIndex
>=
nDimensionCount
)
continue
;
// Each dimension may have primary and secondary axes.
bool
bChartTypeAllowsDateAxis
=
ChartTypeHelper
::
isSupportingDateAxis
(
AxisHelper
::
getChartTypeByIndex
(
xCooSys
,
0
),
nDimensionCount
,
nDimensionIndex
);
const
sal_Int32
nMaxAxisIndex
=
xCooSys
->
getMaximumAxisIndexByDimension
(
nDimIndex
);
const
sal_Int32
nMaximumAxisIndex
=
xCooSys
->
getMaximumAxisIndexByDimension
(
nDimensionIndex
);
for
(
sal_Int32
nAxisIndex
=
0
;
nAxisIndex
<=
nMaxAxisIndex
;
++
nAxisIndex
)
for
(
sal_Int32
nAxisIndex
=
0
;
nAxisIndex
<=
nMaximumAxisIndex
;
++
nAxisIndex
)
{
{
uno
::
Reference
<
XAxis
>
xAxis
(
xCooSys
->
getAxisByDimension
(
nDimensionIndex
,
nAxisIndex
)
);
uno
::
Reference
<
XAxis
>
xAxis
=
xCooSys
->
getAxisByDimension
(
nDimIndex
,
nAxisIndex
);
OSL_ASSERT
(
xAxis
.
is
());
if
(
xAxis
.
is
())
if
(
!
xAxis
.
is
())
continue
;
if
(
m_aAxisUsageList
.
find
(
xAxis
)
==
m_aAxisUsageList
.
end
())
{
{
if
(
m_aAxisUsageList
.
find
(
xAxis
)
==
m_aAxisUsageList
.
end
())
// Create axis usage object for this axis.
{
chart2
::
ScaleData
aSourceScale
=
xAxis
->
getScaleData
();
chart2
::
ScaleData
aSourceScale
=
xAxis
->
getScaleData
();
ExplicitCategoriesProvider
*
pExplicitCategoriesProvider
=
pVCooSys
->
getExplicitCategoriesProvider
();
ExplicitCategoriesProvider
*
pCatProvider
=
pVCooSys
->
getExplicitCategoriesProvider
();
if
(
nDimensionIndex
==
0
)
if
(
nDimIndex
==
0
)
AxisHelper
::
checkDateAxis
(
aSourceScale
,
pExplicitCategoriesProvider
,
bChartTypeAllowsDateAxis
);
AxisHelper
::
checkDateAxis
(
aSourceScale
,
pCatProvider
,
bDateAxisAllowed
);
if
(
(
aSourceScale
.
AxisType
==
AxisType
::
CATEGORY
&&
m_bChartTypeUsesShiftedCategoryPositionPerDefault
)
||
(
aSourceScale
.
AxisType
==
AxisType
::
CATEGORY
&&
pExplicitCategoriesProvider
&&
pExplicitCategoriesProvider
->
hasComplexCategories
()
)
bool
bHasComplexCat
=
pCatProvider
&&
pCatProvider
->
hasComplexCategories
();
||
aSourceScale
.
AxisType
==
AxisType
::
DATE
aSourceScale
.
ShiftedCategoryPosition
=
isCategoryPositionShifted
(
aSourceScale
,
bHasComplexCat
);
||
aSourceScale
.
AxisType
==
AxisType
::
SERIES
)
aSourceScale
.
ShiftedCategoryPosition
=
true
;
m_aAxisUsageList
[
xAxis
].
aScaleAutomatism
=
ScaleAutomatism
(
aSourceScale
,
rNullDate
);
else
aSourceScale
.
ShiftedCategoryPosition
=
false
;
m_aAxisUsageList
[
xAxis
].
aScaleAutomatism
=
ScaleAutomatism
(
aSourceScale
,
rNullDate
);
}
AxisUsage
&
rAxisUsage
=
m_aAxisUsageList
[
xAxis
];
rAxisUsage
.
addCoordinateSystem
(
pVCooSys
,
nDimensionIndex
,
nAxisIndex
);
}
}
AxisUsage
&
rAxisUsage
=
m_aAxisUsageList
[
xAxis
];
rAxisUsage
.
addCoordinateSystem
(
pVCooSys
,
nDimIndex
,
nAxisIndex
);
}
}
}
}
}
}
// Determine the highest axis index of all dimensions.
::
std
::
map
<
uno
::
Reference
<
XAxis
>
,
AxisUsage
>::
iterator
aAxisIter
=
m_aAxisUsageList
.
begin
();
::
std
::
map
<
uno
::
Reference
<
XAxis
>
,
AxisUsage
>::
iterator
aAxisIter
=
m_aAxisUsageList
.
begin
();
const
::
std
::
map
<
uno
::
Reference
<
XAxis
>
,
AxisUsage
>::
const_iterator
aAxisEndIter
=
m_aAxisUsageList
.
end
();
const
::
std
::
map
<
uno
::
Reference
<
XAxis
>
,
AxisUsage
>::
const_iterator
aAxisEndIter
=
m_aAxisUsageList
.
end
();
//init m_nMaxAxisIndex
m_nMaxAxisIndex
=
0
;
m_nMaxAxisIndex
=
0
;
for
(
sal_Int32
nDimensionIndex
=
0
;
nDimensionIndex
<
3
;
nDimensionIndex
++
)
for
(
size_t
i
=
0
,
n
=
m_rVCooSysList
.
size
();
i
<
n
;
++
i
)
{
{
for
(
aAxisIter
=
m_aAxisUsageList
.
begin
();
aAxisIter
!=
aAxisEndIter
;
++
aAxisIter
)
VCoordinateSystem
*
pVCooSys
=
m_rVCooSysList
[
i
];
uno
::
Reference
<
XCoordinateSystem
>
xCooSys
=
pVCooSys
->
getModel
();
sal_Int32
nDimCount
=
xCooSys
->
getDimension
();
for
(
sal_Int32
nDimIndex
=
0
;
nDimIndex
<
nDimCount
;
++
nDimIndex
)
{
{
sal_Int32
nLocalMax
=
aAxisIter
->
second
.
getMaxAxisIndexForDimension
(
nDimensionIndex
);
for
(
aAxisIter
=
m_aAxisUsageList
.
begin
();
aAxisIter
!=
aAxisEndIter
;
++
aAxisIter
)
if
(
m_nMaxAxisIndex
<
nLocalMax
)
{
m_nMaxAxisIndex
=
nLocalMax
;
sal_Int32
nLocalMax
=
aAxisIter
->
second
.
getMaxAxisIndexForDimension
(
nDimIndex
);
if
(
m_nMaxAxisIndex
<
nLocalMax
)
m_nMaxAxisIndex
=
nLocalMax
;
}
}
}
}
}
}
}
...
...
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