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
4b5214f0
Kaydet (Commit)
4b5214f0
authored
Agu 27, 2010
tarafından
Ingrid Halama
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
chart50: #i113950# ODF: don't export text:id with bad value
üst
27d42b73
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
25 deletions
+108
-25
SchXMLExport.cxx
xmloff/source/chart/SchXMLExport.cxx
+14
-24
SchXMLTableContext.cxx
xmloff/source/chart/SchXMLTableContext.cxx
+69
-1
SchXMLTools.cxx
xmloff/source/chart/SchXMLTools.cxx
+23
-0
SchXMLTools.hxx
xmloff/source/chart/SchXMLTools.hxx
+2
-0
No files found.
xmloff/source/chart/SchXMLExport.cxx
Dosyayı görüntüle @
4b5214f0
...
...
@@ -1688,20 +1688,16 @@ void SchXMLExportHelper_Impl::exportTable()
{
mrExport
.
AddAttribute
(
XML_NAMESPACE_OFFICE
,
XML_VALUE_TYPE
,
XML_STRING
);
SvXMLElementExport
aCell
(
mrExport
,
XML_NAMESPACE_TABLE
,
XML_TABLE_CELL
,
sal_True
,
sal_True
);
// write the original range name as id into the local table
// to allow a correct re-association when copying via clipboard
exportText
(
*
aIt
);
if
(
nC
<
nComplexCount
)
lcl_exportComplexLabel
(
rComplexColumnDescriptions
[
nC
++
],
mrExport
);
if
(
!
bHasOwnData
&&
aColumnDescriptions_RangeIter
!=
aColumnDescriptions_RangeEnd
)
{
// remind the original range to allow a correct re-association when copying via clipboard
if
((
*
aColumnDescriptions_RangeIter
).
getLength
())
{
mrExport
.
AddAttributeIdLegacy
(
XML_NAMESPACE_TEXT
,
*
aColumnDescriptions_RangeIter
);
}
SchXMLTools
::
exportRangeToSomewhere
(
mrExport
,
*
aColumnDescriptions_RangeIter
);
++
aColumnDescriptions_RangeIter
;
}
exportText
(
*
aIt
);
if
(
nC
<
nComplexCount
)
lcl_exportComplexLabel
(
rComplexColumnDescriptions
[
nC
++
],
mrExport
);
}
OSL_ASSERT
(
bHasOwnData
||
aColumnDescriptions_RangeIter
==
aColumnDescriptions_RangeEnd
);
}
// closing row and header-rows elements
...
...
@@ -1725,17 +1721,15 @@ void SchXMLExportHelper_Impl::exportTable()
SvXMLElementExport
aCell
(
mrExport
,
XML_NAMESPACE_TABLE
,
XML_TABLE_CELL
,
sal_True
,
sal_True
);
if
(
aRowDescriptionsIter
!=
aData
.
aRowDescriptions
.
end
())
{
// write the original range name as id into the local table
// to allow a correct re-association when copying via clipboard
if
(
!
bHasOwnData
&&
aRowDescriptions_RangeIter
!=
aRowDescriptions_RangeEnd
)
{
mrExport
.
AddAttributeIdLegacy
(
XML_NAMESPACE_TEXT
,
*
aRowDescriptions_RangeIter
++
);
}
exportText
(
*
aRowDescriptionsIter
);
++
aRowDescriptionsIter
;
if
(
nC
<
nComplexCount
)
lcl_exportComplexLabel
(
rComplexRowDescriptions
[
nC
++
],
mrExport
);
if
(
!
bHasOwnData
&&
aRowDescriptions_RangeIter
!=
aRowDescriptions_RangeEnd
)
{
// remind the original range to allow a correct re-association when copying via clipboard
SchXMLTools
::
exportRangeToSomewhere
(
mrExport
,
*
aRowDescriptions_RangeIter
++
);
}
}
}
...
...
@@ -1748,19 +1742,15 @@ void SchXMLExportHelper_Impl::exportTable()
mrExport
.
AddAttribute
(
XML_NAMESPACE_OFFICE
,
XML_VALUE_TYPE
,
XML_FLOAT
);
mrExport
.
AddAttribute
(
XML_NAMESPACE_OFFICE
,
XML_VALUE
,
msString
);
SvXMLElementExport
aCell
(
mrExport
,
XML_NAMESPACE_TABLE
,
XML_TABLE_CELL
,
sal_True
,
sal_True
);
// write the original range name as id into the local table to
// allow a correct re-association when copying via clipboard
exportText
(
msString
,
false
);
// do not convert tabs and lfs
if
(
(
!
bHasOwnData
&&
aDataRangeIter
!=
aDataRangeEndIter
)
&&
(
mbRowSourceColumns
||
(
aColIt
==
aRowIt
->
begin
()))
)
(
mbRowSourceColumns
||
(
aColIt
==
aRowIt
->
begin
())
)
)
{
// remind the original range to allow a correct re-association when copying via clipboard
if
((
*
aDataRangeIter
).
getLength
())
{
mrExport
.
AddAttributeIdLegacy
(
XML_NAMESPACE_TEXT
,
*
aDataRangeIter
);
}
SchXMLTools
::
exportRangeToSomewhere
(
mrExport
,
*
aDataRangeIter
);
++
aDataRangeIter
;
}
exportText
(
msString
,
false
);
// do not convert tabs and lfs
}
}
}
...
...
xmloff/source/chart/SchXMLTableContext.cxx
Dosyayı görüntüle @
4b5214f0
...
...
@@ -34,6 +34,7 @@
#include "SchXMLImport.hxx"
#include "SchXMLTools.hxx"
#include "transporttypes.hxx"
#include "XMLStringBufferImportContext.hxx"
#include <tools/debug.hxx>
#include <rtl/math.hxx>
#include "xmlnmspe.hxx"
...
...
@@ -687,6 +688,35 @@ SvXMLImportContext* SchXMLTableRowContext::CreateChildContext(
return
pContext
;
}
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
class
SchXMLRangeSomewhereContext
:
public
SvXMLImportContext
{
//#i113950# previously the range was exported to attribute text:id,
//but that attribute does not allow arbitrary strings anymore
//so we need to find an alternative to save that range info for copy/paste scenario ...
//-> use description at an empty group element for now
private
:
::
rtl
::
OUString
&
mrRangeString
;
::
rtl
::
OUStringBuffer
maRangeStringBuffer
;
public
:
SchXMLRangeSomewhereContext
(
SvXMLImport
&
rImport
,
const
::
rtl
::
OUString
&
rLocalName
,
::
rtl
::
OUString
&
rRangeString
);
virtual
~
SchXMLRangeSomewhereContext
();
virtual
SvXMLImportContext
*
CreateChildContext
(
USHORT
nPrefix
,
const
::
rtl
::
OUString
&
rLocalName
,
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
);
virtual
void
EndElement
();
};
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
// ========================================
// classes for cells and their content
...
...
@@ -778,11 +808,18 @@ SvXMLImportContext* SchXMLTableCellContext::CreateChildContext(
pContext
=
new
SchXMLTextListContext
(
GetImport
(),
rLocalName
,
*
rCell
.
pComplexString
);
mbReadText
=
sal_False
;
//don't apply text from <text:p>
}
// <text:p> element - read text
and range-id
// <text:p> element - read text
(and range from text:id old version)
else
if
(
nPrefix
==
XML_NAMESPACE_TEXT
&&
IsXMLToken
(
rLocalName
,
XML_P
)
)
{
pContext
=
new
SchXMLParagraphContext
(
GetImport
(),
rLocalName
,
maCellContent
,
&
maRangeId
);
}
// <draw:g> element - read range
else
if
(
nPrefix
==
XML_NAMESPACE_DRAW
&&
IsXMLToken
(
rLocalName
,
XML_G
)
)
{
//#i113950# previously the range was exported to attribute text:id, but that attribute does not allow arbitrary strings anymore
//so we need to find an alternative to save that range info for copy/paste scenario ... -> use description at an empty group element for now
pContext
=
new
SchXMLRangeSomewhereContext
(
GetImport
(),
rLocalName
,
maRangeId
);
}
else
{
pContext
=
new
SvXMLImportContext
(
GetImport
(),
nPrefix
,
rLocalName
);
...
...
@@ -1148,3 +1185,34 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary(
}
}
//---------------------------------------------------------------------------------------------------
SchXMLRangeSomewhereContext
::
SchXMLRangeSomewhereContext
(
SvXMLImport
&
rImport
,
const
OUString
&
rLocalName
,
OUString
&
rRangeString
)
:
SvXMLImportContext
(
rImport
,
XML_NAMESPACE_TEXT
,
rLocalName
),
mrRangeString
(
rRangeString
)
{
}
SchXMLRangeSomewhereContext
::~
SchXMLRangeSomewhereContext
()
{
}
SvXMLImportContext
*
SchXMLRangeSomewhereContext
::
CreateChildContext
(
USHORT
nPrefix
,
const
OUString
&
rLocalName
,
const
uno
::
Reference
<
xml
::
sax
::
XAttributeList
>&
)
{
if
(
XML_NAMESPACE_SVG
==
nPrefix
&&
IsXMLToken
(
rLocalName
,
XML_DESC
)
)
{
return
new
XMLStringBufferImportContext
(
GetImport
(),
nPrefix
,
rLocalName
,
maRangeStringBuffer
);
}
return
new
SvXMLImportContext
(
GetImport
(),
nPrefix
,
rLocalName
);
}
void
SchXMLRangeSomewhereContext
::
EndElement
()
{
mrRangeString
=
maRangeStringBuffer
.
makeStringAndClear
();
}
xmloff/source/chart/SchXMLTools.cxx
Dosyayı görüntüle @
4b5214f0
...
...
@@ -600,6 +600,29 @@ void exportText( SvXMLExport& rExport, const OUString& rText, bool bConvertTabsL
}
}
void
exportRangeToSomewhere
(
SvXMLExport
&
rExport
,
const
::
rtl
::
OUString
&
rValue
)
{
//with issue #i366# and CWS chart20 ranges for error bars were introduced
//to keep them during copy paste from calc to impress for example it
//was necessary to introduce a mapping between the used ranges within calc and the data written to the local table
//this is why we write this ranges here
//#i113950# first the range was exported to attribute text:id, but that attribute does not allow arbitrary strings anymore within ODF 1.2
//as an alternative the range info is now saved into the description at an empty group element (not very nice, but ODF conform)
const
SvtSaveOptions
::
ODFDefaultVersion
nCurrentODFVersion
(
SvtSaveOptions
().
GetODFDefaultVersion
()
);
if
(
nCurrentODFVersion
==
SvtSaveOptions
::
ODFVER_010
||
nCurrentODFVersion
==
SvtSaveOptions
::
ODFVER_011
)
return
;
//svg:desc is not allowed at draw:g in ODF1.0; but as the ranges for error bars are anyhow not allowed within ODF1.0 nor ODF1.1 we do not need the information
SvXMLElementExport
aEmptyShapeGroup
(
rExport
,
XML_NAMESPACE_DRAW
,
::
xmloff
::
token
::
GetXMLToken
(
::
xmloff
::
token
::
XML_G
),
sal_True
,
sal_False
);
SvXMLElementExport
aDescription
(
rExport
,
XML_NAMESPACE_SVG
,
::
xmloff
::
token
::
GetXMLToken
(
::
xmloff
::
token
::
XML_DESC
),
sal_True
,
sal_False
);
rExport
.
GetDocHandler
()
->
characters
(
rValue
);
}
Reference
<
chart2
::
XRegressionCurve
>
getRegressionCurve
(
const
Reference
<
chart2
::
XDataSeries
>
&
xDataSeries
)
{
...
...
xmloff/source/chart/SchXMLTools.hxx
Dosyayı görüntüle @
4b5214f0
...
...
@@ -105,6 +105,8 @@ namespace SchXMLTools
void
exportText
(
SvXMLExport
&
rExport
,
const
::
rtl
::
OUString
&
rText
,
bool
bConvertTabsLFs
);
void
exportRangeToSomewhere
(
SvXMLExport
&
rExport
,
const
::
rtl
::
OUString
&
rValue
);
/** returns the properties of the equation of the first regression curve
that is no mean-value line
*/
...
...
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