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
b8c444a4
Kaydet (Commit)
b8c444a4
authored
Tem 07, 2014
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bnc#881025: Mark axis a percent axis only when all data series are percent.
Change-Id: I302cc1e5b164b2ce9999087293b034ec930951af
üst
af5a6615
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
16 deletions
+38
-16
axisconverter.hxx
oox/inc/drawingml/chart/axisconverter.hxx
+4
-6
axisconverter.cxx
oox/source/drawingml/chart/axisconverter.cxx
+31
-7
plotareaconverter.cxx
oox/source/drawingml/chart/plotareaconverter.cxx
+3
-3
No files found.
oox/inc/drawingml/chart/axisconverter.hxx
Dosyayı görüntüle @
b8c444a4
...
@@ -60,12 +60,10 @@ public:
...
@@ -60,12 +60,10 @@ public:
virtual
~
AxisConverter
();
virtual
~
AxisConverter
();
/** Creates a chart2 axis and inserts it into the passed coordinate system. */
/** Creates a chart2 axis and inserts it into the passed coordinate system. */
void
convertFromModel
(
void
convertFromModel
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
chart2
::
XCoordinateSystem
>&
rxCoordSystem
,
const
css
::
uno
::
Reference
<
css
::
chart2
::
XCoordinateSystem
>&
rxCoordSystem
,
TypeGroupConverter
&
rTypeGroup
,
RefVector
<
TypeGroupConverter
>&
rTypeGroups
,
const
AxisModel
*
pCrossingAxis
,
const
AxisModel
*
pCrossingAxis
,
sal_Int32
nAxesSetIdx
,
sal_Int32
nAxisIdx
);
sal_Int32
nAxesSetIdx
,
sal_Int32
nAxisIdx
);
};
};
...
...
oox/source/drawingml/chart/axisconverter.cxx
Dosyayı görüntüle @
b8c444a4
...
@@ -103,6 +103,26 @@ sal_Int32 lclGetTickMark( sal_Int32 nToken )
...
@@ -103,6 +103,26 @@ sal_Int32 lclGetTickMark( sal_Int32 nToken )
return
NONE
;
return
NONE
;
}
}
/**
* The groups is of percent type only when all of its members are of percent
* type.
*/
bool
isPercent
(
const
RefVector
<
TypeGroupConverter
>&
rTypeGroups
)
{
if
(
rTypeGroups
.
empty
())
return
false
;
RefVector
<
TypeGroupConverter
>::
const_iterator
it
=
rTypeGroups
.
begin
(),
itEnd
=
rTypeGroups
.
end
();
for
(;
it
!=
itEnd
;
++
it
)
{
TypeGroupConverter
&
rConv
=
**
it
;
if
(
!
rConv
.
isPercent
())
return
false
;
}
return
true
;
}
}
// namespace
}
// namespace
AxisConverter
::
AxisConverter
(
const
ConverterRoot
&
rParent
,
AxisModel
&
rModel
)
:
AxisConverter
::
AxisConverter
(
const
ConverterRoot
&
rParent
,
AxisModel
&
rModel
)
:
...
@@ -114,16 +134,20 @@ AxisConverter::~AxisConverter()
...
@@ -114,16 +134,20 @@ AxisConverter::~AxisConverter()
{
{
}
}
void
AxisConverter
::
convertFromModel
(
const
Reference
<
XCoordinateSystem
>&
rxCoordSystem
,
void
AxisConverter
::
convertFromModel
(
TypeGroupConverter
&
rTypeGroup
,
const
AxisModel
*
pCrossingAxis
,
sal_Int32
nAxesSetIdx
,
sal_Int32
nAxisIdx
)
const
Reference
<
XCoordinateSystem
>&
rxCoordSystem
,
RefVector
<
TypeGroupConverter
>&
rTypeGroups
,
const
AxisModel
*
pCrossingAxis
,
sal_Int32
nAxesSetIdx
,
sal_Int32
nAxisIdx
)
{
{
if
(
rTypeGroups
.
empty
())
return
;
Reference
<
XAxis
>
xAxis
;
Reference
<
XAxis
>
xAxis
;
try
try
{
{
namespace
cssc
=
::
com
::
sun
::
star
::
chart
;
namespace
cssc
=
::
com
::
sun
::
star
::
chart
;
namespace
cssc2
=
::
com
::
sun
::
star
::
chart2
;
namespace
cssc2
=
::
com
::
sun
::
star
::
chart2
;
const
TypeGroupInfo
&
rTypeInfo
=
rTypeGroup
.
getTypeInfo
();
const
TypeGroupInfo
&
rTypeInfo
=
rTypeGroup
s
.
front
()
->
getTypeInfo
();
ObjectFormatter
&
rFormatter
=
getFormatter
();
ObjectFormatter
&
rFormatter
=
getFormatter
();
// create the axis object (always)
// create the axis object (always)
...
@@ -183,7 +207,7 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
...
@@ -183,7 +207,7 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
currently). */
currently). */
aScaleData
.
AxisType
=
(
bDateAxis
&&
!
mrModel
.
mbAuto
)
?
cssc2
::
AxisType
::
DATE
:
cssc2
::
AxisType
::
CATEGORY
;
aScaleData
.
AxisType
=
(
bDateAxis
&&
!
mrModel
.
mbAuto
)
?
cssc2
::
AxisType
::
DATE
:
cssc2
::
AxisType
::
CATEGORY
;
aScaleData
.
AutoDateAxis
=
mrModel
.
mbAuto
;
aScaleData
.
AutoDateAxis
=
mrModel
.
mbAuto
;
aScaleData
.
Categories
=
rTypeGroup
.
createCategorySequence
();
aScaleData
.
Categories
=
rTypeGroup
s
.
front
()
->
createCategorySequence
();
}
}
else
else
{
{
...
@@ -193,11 +217,11 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
...
@@ -193,11 +217,11 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
break
;
break
;
case
API_Y_AXIS
:
case
API_Y_AXIS
:
OSL_ENSURE
(
mrModel
.
mnTypeId
==
C_TOKEN
(
valAx
),
"AxisConverter::convertFromModel - unexpected axis model type (must: c:valAx)"
);
OSL_ENSURE
(
mrModel
.
mnTypeId
==
C_TOKEN
(
valAx
),
"AxisConverter::convertFromModel - unexpected axis model type (must: c:valAx)"
);
aScaleData
.
AxisType
=
rTypeGroup
.
isPercent
(
)
?
cssc2
::
AxisType
::
PERCENT
:
cssc2
::
AxisType
::
REALNUMBER
;
aScaleData
.
AxisType
=
isPercent
(
rTypeGroups
)
?
cssc2
::
AxisType
::
PERCENT
:
cssc2
::
AxisType
::
REALNUMBER
;
break
;
break
;
case
API_Z_AXIS
:
case
API_Z_AXIS
:
OSL_ENSURE
(
mrModel
.
mnTypeId
==
C_TOKEN
(
serAx
),
"AxisConverter::convertFromModel - unexpected axis model type (must: c:serAx)"
);
OSL_ENSURE
(
mrModel
.
mnTypeId
==
C_TOKEN
(
serAx
),
"AxisConverter::convertFromModel - unexpected axis model type (must: c:serAx)"
);
OSL_ENSURE
(
rTypeGroup
.
isDeep3dChart
(),
"AxisConverter::convertFromModel - series axis not supported by this chart type"
);
OSL_ENSURE
(
rTypeGroup
s
.
front
()
->
isDeep3dChart
(),
"AxisConverter::convertFromModel - series axis not supported by this chart type"
);
aScaleData
.
AxisType
=
cssc2
::
AxisType
::
SERIES
;
aScaleData
.
AxisType
=
cssc2
::
AxisType
::
SERIES
;
break
;
break
;
}
}
...
@@ -324,7 +348,7 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
...
@@ -324,7 +348,7 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
// axis title ---------------------------------------------------------
// axis title ---------------------------------------------------------
// in radar charts, title objects may exist, but are not shown
// in radar charts, title objects may exist, but are not shown
if
(
mrModel
.
mxTitle
.
is
()
&&
(
rTypeGroup
.
getTypeInfo
().
meTypeCategory
!=
TYPECATEGORY_RADAR
)
)
if
(
mrModel
.
mxTitle
.
is
()
&&
(
rTypeGroup
s
.
front
()
->
getTypeInfo
().
meTypeCategory
!=
TYPECATEGORY_RADAR
)
)
{
{
Reference
<
XTitled
>
xTitled
(
xAxis
,
UNO_QUERY_THROW
);
Reference
<
XTitled
>
xTitled
(
xAxis
,
UNO_QUERY_THROW
);
TitleConverter
aTitleConv
(
*
this
,
*
mrModel
.
mxTitle
);
TitleConverter
aTitleConv
(
*
this
,
*
mrModel
.
mxTitle
);
...
...
oox/source/drawingml/chart/plotareaconverter.cxx
Dosyayı görüntüle @
b8c444a4
...
@@ -163,15 +163,15 @@ void AxesSetConverter::convertFromModel( const Reference< XDiagram >& rxDiagram,
...
@@ -163,15 +163,15 @@ void AxesSetConverter::convertFromModel( const Reference< XDiagram >& rxDiagram,
ModelRef
<
AxisModel
>
xYAxis
=
lclGetOrCreateAxis
(
mrModel
.
maAxes
,
API_Y_AXIS
,
C_TOKEN
(
valAx
)
);
ModelRef
<
AxisModel
>
xYAxis
=
lclGetOrCreateAxis
(
mrModel
.
maAxes
,
API_Y_AXIS
,
C_TOKEN
(
valAx
)
);
AxisConverter
aXAxisConv
(
*
this
,
*
xXAxis
);
AxisConverter
aXAxisConv
(
*
this
,
*
xXAxis
);
aXAxisConv
.
convertFromModel
(
xCoordSystem
,
rFirstTypeGroup
,
xYAxis
.
get
(),
nAxesSetIdx
,
API_X_AXIS
);
aXAxisConv
.
convertFromModel
(
xCoordSystem
,
aTypeGroups
,
xYAxis
.
get
(),
nAxesSetIdx
,
API_X_AXIS
);
AxisConverter
aYAxisConv
(
*
this
,
*
xYAxis
);
AxisConverter
aYAxisConv
(
*
this
,
*
xYAxis
);
aYAxisConv
.
convertFromModel
(
xCoordSystem
,
rFirstTypeGroup
,
xXAxis
.
get
(),
nAxesSetIdx
,
API_Y_AXIS
);
aYAxisConv
.
convertFromModel
(
xCoordSystem
,
aTypeGroups
,
xXAxis
.
get
(),
nAxesSetIdx
,
API_Y_AXIS
);
if
(
rFirstTypeGroup
.
isDeep3dChart
()
)
if
(
rFirstTypeGroup
.
isDeep3dChart
()
)
{
{
ModelRef
<
AxisModel
>
xZAxis
=
lclGetOrCreateAxis
(
mrModel
.
maAxes
,
API_Z_AXIS
,
C_TOKEN
(
serAx
)
);
ModelRef
<
AxisModel
>
xZAxis
=
lclGetOrCreateAxis
(
mrModel
.
maAxes
,
API_Z_AXIS
,
C_TOKEN
(
serAx
)
);
AxisConverter
aZAxisConv
(
*
this
,
*
xZAxis
);
AxisConverter
aZAxisConv
(
*
this
,
*
xZAxis
);
aZAxisConv
.
convertFromModel
(
xCoordSystem
,
rFirstTypeGroup
,
0
,
nAxesSetIdx
,
API_Z_AXIS
);
aZAxisConv
.
convertFromModel
(
xCoordSystem
,
aTypeGroups
,
0
,
nAxesSetIdx
,
API_Z_AXIS
);
}
}
// convert all chart type groups, this converts all series data and formatting
// convert all chart type groups, this converts all series data and formatting
...
...
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