[Libreoffice-commits] .: sc/inc sc/source

Stephan Bergmann sbergman at redhat.com
Thu Sep 6 00:20:20 PDT 2012


On 09/05/2012 05:57 PM, Libreoffice Gerrit user wrote:
> commit bedbb471c3f49e0860dd63b17c1faeee837096ae
> Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
> Date:   Mon Sep 3 19:30:26 2012 +0200
>
>      better import of conditional format from old ODF structure
>
>      The old ODF storage is style based and so the sam cond format can be
>      divided up into several single stlyes which resulted in several new
>      style cond formats.
>
>      Now we check for old stlye cond formats if there is a equal cond format
>      and in this case just extend the area. This should make it easier to
>      transform old documents into the new range based cond formats.
>
>      Change-Id: I51a5148922e19e6860de9915abfc59d49b18d96e
>
> diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
> index 1ef7cda..5776d72 100644
> --- a/sc/source/filter/xml/xmlstyli.cxx
> +++ b/sc/source/filter/xml/xmlstyli.cxx
> @@ -492,13 +408,11 @@ SvXMLImportContext *XMLTableStyleContext::CreateChildContext(
>       if( (XML_NAMESPACE_STYLE == nPrefix) &&
>           IsXMLToken(rLocalName, XML_MAP ) )
>       {
> -        pContext = new ScXMLMapContext(GetImport(), nPrefix, rLocalName, xAttrList);
> -
> -        ScXMLMapContent aMap;
> -        aMap.sCondition = ((ScXMLMapContext*)pContext)->GetCondition();
> -        aMap.sApplyStyle = ((ScXMLMapContext*)pContext)->GetApplyStyle();
> -        aMap.sBaseCell = ((ScXMLMapContext*)pContext)->GetBaseCell();
> -        aMaps.push_back(aMap);
> +        if(!mpCondFormat)
> +            mpCondFormat = new ScConditionalFormat( 0, GetScImport().GetDocument() );
> +        ScXMLMapContext* pMapContext = new ScXMLMapContext(GetImport(), nPrefix, rLocalName, xAttrList);
> +        pContext = pContext;

Should that rather be pContext = pMapContext?

Stephan

> +        mpCondFormat->AddEntry(pMapContext->CreateConditionEntry());
>       }
>       if (!pContext)
>           pContext = XMLPropStyleContext::CreateChildContext( nPrefix, rLocalName,



More information about the LibreOffice mailing list