Related: tdf#160517 - chart odf: import/export formatted chart titles

No need to check chart title paragraph style name and ID, since its
never exists.

follow-up of:
d7214aba95
6fdad72372

Change-Id: Ieffe3026adc848cfbf3a847b4f876b5aa2e2a026
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177011
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Tested-by: Jenkins
This commit is contained in:
Balazs Varga 2024-11-22 12:11:07 +01:00
parent bbad335816
commit 869fff459c
2 changed files with 1 additions and 42 deletions

View file

@ -104,50 +104,13 @@ void SchXMLParagraphContext::characters( const OUString& rChars )
SchXMLTitleParaContext::SchXMLTitleParaContext( SvXMLImport& rImport,
std::vector<std::pair<OUString, OUString>>& rParaText) :
SvXMLImportContext( rImport ),
mrParaText( rParaText ),
mpId( nullptr )
mrParaText( rParaText )
{
}
SchXMLTitleParaContext::~SchXMLTitleParaContext()
{}
void SchXMLTitleParaContext::startFastElement(
sal_Int32 /*nElement*/,
const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
{
// remember the id. It is used for storing the original cell range string in
// a local table (cached data)
if( !mpId )
return;
bool bHaveXmlId( false );
for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
{
switch(aIter.getToken())
{
case XML_ELEMENT(TEXT, XML_STYLE_NAME):
maStyleName = aIter.toString();
break;
case XML_ELEMENT(XML, XML_ID):
(*mpId) = aIter.toString();
bHaveXmlId = true;
break;
case XML_ELEMENT(TEXT, XML_ID):
{ // text:id shall be ignored if xml:id exists
if (!bHaveXmlId)
{
(*mpId) = aIter.toString();
}
break;
}
default:
XMLOFF_WARN_UNKNOWN("xmloff", aIter);
}
}
}
void SchXMLTitleParaContext::endFastElement(sal_Int32 )
{
if (!maBuffer.isEmpty())

View file

@ -54,7 +54,6 @@ class SchXMLTitleParaContext : public SvXMLImportContext
{
private:
std::vector<std::pair<OUString, OUString>>& mrParaText;
OUString* mpId;
OUStringBuffer maBuffer;
OUString maStyleName;
@ -63,9 +62,6 @@ public:
std::vector<std::pair<OUString, OUString>>& rParaText);
virtual ~SchXMLTitleParaContext() override;
virtual void SAL_CALL startFastElement(
sal_Int32 nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
virtual void SAL_CALL characters( const OUString& rChars ) override;