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
32edd34a
Kaydet (Commit)
32edd34a
authored
Şub 13, 2013
tarafından
Katarina Behrens
Kaydeden (comit)
Thorsten Behrens
Şub 13, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#59789: xlsx export of data point labels, first cut
Change-Id: I4a9d893ce7999970a559851ce2faac50b3d01b6e
üst
30862ca4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
1 deletion
+83
-1
chartexport.hxx
oox/inc/oox/export/chartexport.hxx
+3
-0
chartexport.cxx
oox/source/export/chartexport.cxx
+80
-1
No files found.
oox/inc/oox/export/chartexport.hxx
Dosyayı görüntüle @
32edd34a
...
@@ -159,6 +159,9 @@ private:
...
@@ -159,6 +159,9 @@ private:
void
exportDataPoints
(
void
exportDataPoints
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>&
xSeriesProperties
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>&
xSeriesProperties
,
sal_Int32
nSeriesLength
);
sal_Int32
nSeriesLength
);
void
exportDataLabels
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>&
xSeriesProperties
,
sal_Int32
nSeriesLength
);
void
exportGrouping
(
sal_Bool
isBar
=
sal_False
);
void
exportGrouping
(
sal_Bool
isBar
=
sal_False
);
void
exportMarker
();
void
exportMarker
();
void
exportSmooth
();
void
exportSmooth
();
...
...
oox/source/export/chartexport.cxx
Dosyayı görüntüle @
32edd34a
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart/ChartSolidType.hpp>
#include <com/sun/star/chart/ChartSolidType.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
...
@@ -51,6 +52,7 @@
...
@@ -51,6 +52,7 @@
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
...
@@ -1546,7 +1548,8 @@ void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_
...
@@ -1546,7 +1548,8 @@ void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_
}
}
}
}
// TODO: Data Labels: show data lables
// export data labels
exportDataLabels
(
uno
::
Reference
<
beans
::
XPropertySet
>
(
aSeriesSeq
[
nSeriesIdx
],
uno
::
UNO_QUERY
),
nSeriesLength
);
// export data points
// export data points
exportDataPoints
(
uno
::
Reference
<
beans
::
XPropertySet
>
(
aSeriesSeq
[
nSeriesIdx
],
uno
::
UNO_QUERY
),
nSeriesLength
);
exportDataPoints
(
uno
::
Reference
<
beans
::
XPropertySet
>
(
aSeriesSeq
[
nSeriesIdx
],
uno
::
UNO_QUERY
),
nSeriesLength
);
...
@@ -2284,6 +2287,82 @@ void ChartExport::_exportAxis(
...
@@ -2284,6 +2287,82 @@ void ChartExport::_exportAxis(
pFS
->
endElement
(
FSNS
(
XML_c
,
nAxisType
)
);
pFS
->
endElement
(
FSNS
(
XML_c
,
nAxisType
)
);
}
}
void
ChartExport
::
exportDataLabels
(
const
uno
::
Reference
<
beans
::
XPropertySet
>
&
xSeriesProperties
,
sal_Int32
nSeriesLength
)
{
// TODO: export field separators, missing flag vs. showing series name or not
uno
::
Reference
<
chart2
::
XDataSeries
>
xSeries
(
xSeriesProperties
,
uno
::
UNO_QUERY
);
Sequence
<
sal_Int32
>
aDataPointSeq
;
if
(
xSeriesProperties
.
is
())
{
FSHelperPtr
pFS
=
GetFS
();
pFS
->
startElement
(
FSNS
(
XML_c
,
XML_dLbls
),
FSEND
);
sal_Int32
nElem
;
for
(
nElem
=
0
;
nElem
<
nSeriesLength
;
++
nElem
)
{
uno
::
Reference
<
beans
::
XPropertySet
>
xPropSet
;
try
{
xPropSet
=
SchXMLSeriesHelper
::
createOldAPIDataPointPropertySet
(
xSeries
,
nElem
,
getModel
()
);
}
catch
(
const
uno
::
Exception
&
rEx
)
{
(
void
)
rEx
;
// avoid warning for pro build
OSL_TRACE
(
"Exception caught during Export of data label: %s"
,
rtl
::
OUStringToOString
(
rEx
.
Message
,
RTL_TEXTENCODING_ASCII_US
).
getStr
()
);
}
if
(
xPropSet
.
is
()
)
{
namespace
cssc2
=
::
com
::
sun
::
star
::
chart2
;
cssc2
::
DataPointLabel
aLabel
;
if
(
GetProperty
(
xPropSet
,
S
(
"Label"
)
)
)
{
mAny
>>=
aLabel
;
namespace
csscd
=
::
com
::
sun
::
star
::
chart
::
DataLabelPlacement
;
sal_Int32
nPlacement
;
const
char
*
aPlacement
=
NULL
;
if
(
GetProperty
(
xPropSet
,
S
(
"LabelPlacement"
)
)
)
mAny
>>=
nPlacement
;
switch
(
nPlacement
)
{
case
csscd
:
:
OUTSIDE
:
aPlacement
=
"outEnd"
;
break
;
case
csscd
:
:
INSIDE
:
aPlacement
=
"inEnd"
;
break
;
case
csscd
:
:
CENTER
:
aPlacement
=
"ctr"
;
break
;
case
csscd
:
:
NEAR_ORIGIN
:
aPlacement
=
"inBase"
;
break
;
case
csscd
:
:
TOP
:
aPlacement
=
"t"
;
break
;
case
csscd
:
:
BOTTOM
:
aPlacement
=
"b"
;
break
;
case
csscd
:
:
LEFT
:
aPlacement
=
"l"
;
break
;
case
csscd
:
:
RIGHT
:
aPlacement
=
"r"
;
break
;
case
csscd
:
:
AVOID_OVERLAP
:
aPlacement
=
"bestFit"
;
break
;
}
pFS
->
startElement
(
FSNS
(
XML_c
,
XML_dLbl
),
FSEND
);
pFS
->
singleElement
(
FSNS
(
XML_c
,
XML_idx
),
XML_val
,
I32S
(
nElem
),
FSEND
);
pFS
->
singleElement
(
FSNS
(
XML_c
,
XML_dLblPos
),
XML_val
,
aPlacement
,
FSEND
);
pFS
->
singleElement
(
FSNS
(
XML_c
,
XML_showLegendKey
),
XML_val
,
aLabel
.
ShowLegendSymbol
?
"1"
:
"0"
,
FSEND
);
pFS
->
singleElement
(
FSNS
(
XML_c
,
XML_showVal
),
XML_val
,
aLabel
.
ShowNumber
?
"1"
:
"0"
,
FSEND
);
pFS
->
singleElement
(
FSNS
(
XML_c
,
XML_showCatName
),
XML_val
,
aLabel
.
ShowCategoryName
?
"1"
:
"0"
,
FSEND
);
pFS
->
singleElement
(
FSNS
(
XML_c
,
XML_showPercent
),
XML_val
,
aLabel
.
ShowNumberInPercent
?
"1"
:
"0"
,
FSEND
);
pFS
->
endElement
(
FSNS
(
XML_c
,
XML_dLbl
));
}
}
}
pFS
->
endElement
(
FSNS
(
XML_c
,
XML_dLbls
)
);
}
}
void
ChartExport
::
exportDataPoints
(
void
ChartExport
::
exportDataPoints
(
const
uno
::
Reference
<
beans
::
XPropertySet
>
&
xSeriesProperties
,
const
uno
::
Reference
<
beans
::
XPropertySet
>
&
xSeriesProperties
,
sal_Int32
nSeriesLength
)
sal_Int32
nSeriesLength
)
...
...
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