[Libreoffice-commits] .: 15 commits -

Jan Holesovsky kendy at kemper.freedesktop.org
Thu Jul 28 09:40:58 PDT 2011


 0 files changed

New commits:
commit 73f09647b126a7cc78ad405eb57540f9c999ce99
Merge: ddbbc1c... b0c8163...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Jul 28 18:37:37 2011 +0200

    Merge commit 'libreoffice-3.4.2.3'
    
    Conflicts:
    	oox/source/drawingml/chart/objectformatter.cxx
    	oox/source/xls/formulaparser.cxx
    	oox/source/xls/sheetdatacontext.cxx

commit b0c8163070d8d032e82421f9863b14a760527daa
Author: Petr Mladek <pmladek at suse.cz>
Date:   Mon Jul 25 20:28:42 2011 +0200

    Version 3.4.2.3, tag libreoffice-3.4.2.3 (3.4.2-rc3)
commit 2626bfed31598c8d171392a56bda308fd76b08e7
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Jul 19 17:07:58 2011 +0200

    Version 3.4.2.2, tag libreoffice-3.4.2.2 (3.4.2-rc2)
commit e3af3c46c32291c64a81d4b9564ebe09703876da
Author: Muthu Subramanian <sumuthu at novell.com>
Date:   Tue Jul 19 13:24:03 2011 +0200

    related fdo#39023: correct import of shared formulas
    
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Signed-off-by: Katarina Machalkova <kmachalkova at suse.cz>
    Signed-off-by: David Tardon <dtardon at redhat.com>

diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx
index 2f0be89..4c5424d 100644
--- a/oox/source/xls/sheetdatacontext.cxx
+++ b/oox/source/xls/sheetdatacontext.cxx
@@ -227,9 +227,6 @@ void SheetDataContext::onCharacters( const OUString& rChars )
                         {
                             if( rChars.getLength() > 0 )
                                 getSharedFormulas().importSharedFmla( rChars, maCurrCell.maFormulaRef, maCurrCell.mnSharedId, maCurrCell.maAddress );
-                            Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY_THROW );
-                            ExtCellFormulaContext aContext( *this, xTokens, maCurrCell.maAddress );
-                            getSharedFormulas().setSharedFormulaCell( aContext, maCurrCell.mnSharedId );
                         }
                     break;
 
@@ -279,6 +276,12 @@ void SheetDataContext::onEndElement()
                 maCurrCell.mnCellType = XML_TOKEN_INVALID;
             }
         }
+        if( maCurrCell.mnSharedId >= 0 )
+        {
+            Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY_THROW );
+            ExtCellFormulaContext aContext( *this, xTokens, maCurrCell.maAddress );
+            getSharedFormulas().setSharedFormulaCell( aContext, maCurrCell.mnSharedId );
+        }
 
         // store the cell formatting data
         setCellFormat( maCurrCell );
commit 02147c8332d0104dbcba33fee8ff912eda600b5d
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Jul 12 16:41:09 2011 +0200

    Branch libreoffice-3-4-2
    
    This is 'libreoffice-3-4-2' - the stable branch for the 3.4.2 release.
    Only very safe changes, reviewed by three people are allowed.
    
    If you want to commit more complicated fix for the next 3.4.x release,
    please use the 'libreoffice-3-4' branch.
    
    If you want to build something cool, unstable, and risky, use master.
commit 721339728cd5532b47c5cc98fad762b723b093e4
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Jul 12 15:49:40 2011 +0200

    Version 3.4.2.1, tag libreoffice-3.4.2.1 (3.4.2-rc1)
commit f388b40e50a751c104e3e6a965f57b9aa806c5dc
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Jul 12 01:51:46 2011 +0200

    fix for fdo#39023: shared formulas are not imported correctly
    
    Signed-off-by: Kohei Yoshida <kyoshida at novell.com>

diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx
index 2d919a6..429bc13 100644
--- a/oox/source/xls/formulaparser.cxx
+++ b/oox/source/xls/formulaparser.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/sheet/ComplexReference.hpp>
 #include <com/sun/star/sheet/ExternalReference.hpp>
 #include <com/sun/star/sheet/FormulaToken.hpp>
+#include <com/sun/star/sheet/NameToken.hpp>
 #include <com/sun/star/sheet/ReferenceFlags.hpp>
 #include <com/sun/star/sheet/SingleReference.hpp>
 #include "oox/core/filterbase.hxx"
@@ -2798,7 +2799,10 @@ void FormulaParser::convertNameToFormula( FormulaContext& rContext, sal_Int32 nT
     {
         ApiTokenSequence aTokens( 1 );
         aTokens[ 0 ].OpCode = OPCODE_NAME;
-        aTokens[ 0 ].Data <<= nTokenIndex;
+        NameToken aNameTokenData;
+        aNameTokenData.Global = sal_True;
+        aNameTokenData.Index= nTokenIndex;
+        aTokens[ 0 ].Data <<= aNameTokenData;
         mxImpl->setFormula( rContext, aTokens );
     }
     else
commit d0df132019508db609fada9508504341d081fbbf
Author: Muthu Subramanian <sumuthu at novell.com>
Date:   Thu Jul 7 12:22:49 2011 +0530

    n#694356: Using formatcode while displaying labels.
    
    Used when the lables don't have their own formatcode
    and depend on the data's format code for formatting.
    
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>

diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx
index 4cc2a8d..3c17c98 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -315,7 +315,11 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
         // number format ------------------------------------------------------
 
         if( (aScaleData.AxisType == cssc2::AxisType::REALNUMBER) || (aScaleData.AxisType == cssc2::AxisType::PERCENT) )
+        {
+            if( mrModel.maNumberFormat.maFormatCode.indexOfAsciiL("%",1) >= 0)
+                mrModel.maNumberFormat.mbSourceLinked = false;
             getFormatter().convertNumberFormat( aAxisProp, mrModel.maNumberFormat );
+        }
 
         // position of crossing axis ------------------------------------------
 
diff --git a/oox/source/drawingml/chart/chartconverter.cxx b/oox/source/drawingml/chart/chartconverter.cxx
index 8f56b62..c9f44d0 100644
--- a/oox/source/drawingml/chart/chartconverter.cxx
+++ b/oox/source/drawingml/chart/chartconverter.cxx
@@ -59,7 +59,7 @@ static const sal_Unicode API_TOKEN_ARRAY_CLOSE     = '}';
 static const sal_Unicode API_TOKEN_ARRAY_ROWSEP    = '|';
 static const sal_Unicode API_TOKEN_ARRAY_COLSEP    = ';';
 
-// Code similar to oox/source/xls/FormulaParser.cxx
+// Code similar to oox/source/xls/formulabase.cxx
 static OUString lclGenerateApiString( const OUString& rString )
 {
     OUString aRetString = rString;
@@ -69,7 +69,7 @@ static OUString lclGenerateApiString( const OUString& rString )
     return OUStringBuffer().append( sal_Unicode( '"' ) ).append( aRetString ).append( sal_Unicode( '"' ) ).makeStringAndClear();
 }
 
-    static ::rtl::OUString lclGenerateApiArray( const Matrix< Any >& rMatrix )
+static ::rtl::OUString lclGenerateApiArray( const Matrix< Any >& rMatrix )
 {
     OSL_ENSURE( !rMatrix.empty(), "ChartConverter::lclGenerateApiArray - missing matrix values" );
     OUStringBuffer aBuffer;
@@ -156,7 +156,7 @@ Reference< XDataSequence > ChartConverter::createDataSequence( const Reference<
         }
         catch( Exception& )
         {
-            OSL_FAIL( "ExcelChartConverter::createDataSequence - cannot create data sequence" );
+            OSL_FAIL( "ChartConverter::createDataSequence - cannot create data sequence" );
         }
     }
 
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index 7b3d266..2a2564f 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -124,6 +124,13 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatt
 
     bool bShowValue   = !rDataLabel.mbDeleted && rDataLabel.mobShowVal.get( false );
     bool bShowPercent = !rDataLabel.mbDeleted && rDataLabel.mobShowPercent.get( false ) && (rTypeInfo.meTypeCategory == TYPECATEGORY_PIE);
+    if( bShowValue &&
+        !bShowPercent && rTypeInfo.meTypeCategory == TYPECATEGORY_PIE &&
+        rDataLabel.maNumberFormat.maFormatCode.indexOfAsciiL("%", 1) >= 0 )
+    {
+        bShowValue = false;
+        bShowPercent = true;
+    }
     bool bShowCateg   = !rDataLabel.mbDeleted && rDataLabel.mobShowCatName.get( false );
     bool bShowSymbol  = !rDataLabel.mbDeleted && rDataLabel.mobShowLegendKey.get( false );
 
@@ -237,6 +244,7 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa
     // data point label settings
     for( DataLabelsModel::DataLabelVector::iterator aIt = mrModel.maPointLabels.begin(), aEnd = mrModel.maPointLabels.end(); aIt != aEnd; ++aIt )
     {
+        (*aIt)->maNumberFormat.maFormatCode = mrModel.maNumberFormat.maFormatCode;
         DataLabelConverter aLabelConv( *this, **aIt );
         aLabelConv.convertFromModel( rxDataSeries, rTypeGroup );
     }
@@ -627,6 +635,12 @@ Reference< XDataSeries > SeriesConverter::createDataSeries( const TypeGroupConve
     ModelRef< DataLabelsModel > xLabels = mrModel.mxLabels.is() ? mrModel.mxLabels : rTypeGroup.getModel().mxLabels;
     if( xLabels.is() )
     {
+        if( xLabels->maNumberFormat.maFormatCode.isEmpty() )
+        {
+            // Use number format code from Value series
+            DataSourceModel* pValues = mrModel.maSources.get( SeriesModel::VALUES ).get();
+            xLabels->maNumberFormat.maFormatCode = pValues->mxDataSeq->maFormatCode;
+        }
         DataLabelsConverter aLabelsConv( *this, *xLabels );
         aLabelsConv.convertFromModel( xDataSeries, rTypeGroup );
     }
commit 8975158e0144772f8f288e2321d8f13a0bb6d956
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jul 2 21:58:33 2011 +0100

    Resolves: fdo#34023 apparent negative string length
    
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>

diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx
index fe13e5c..f3ff612 100644
--- a/filter/source/msfilter/mstoolbar.cxx
+++ b/filter/source/msfilter/mstoolbar.cxx
@@ -421,7 +421,7 @@ WString::Read( SvStream *pS )
 {
     OSL_TRACE("WString::Read() stream pos 0x%x", pS->Tell() );
     nOffSet = pS->Tell();
-    sal_Int8 nChars = 0;
+    sal_uInt8 nChars = 0;
     *pS >> nChars;
     sString = readUnicodeString( pS, nChars );
     return true;
commit 21a9b9c3a6cd8c666ed8385b6acd8a456c7820c7
Author: Radek Doulik <rodo at novell.com>
Date:   Fri Jul 8 13:12:39 2011 +0300

    do not set solid line border and fill as default for chartarea
    
    - fixes n#694392
    
    Signed-off-by: Tor Lillqvist <tlillqvist at novell.com>

diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index 61b3bfe..0496529 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -190,7 +190,7 @@ static const AutoFormatEntry spNoFormats[] =
     AUTOFORMAT_END()
 };
 
-static const AutoFormatEntry spChartSpaceLines[] =
+static const AutoFormatEntry spDataTableLines[] =
 {
     AUTOFORMAT_COLORMOD(  1, 32, THEMED_STYLE_SUBTLE, XML_tx1, XML_tint, 75000 ),
     AUTOFORMAT_COLORMOD( 33, 40, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 75000 ),
@@ -198,14 +198,6 @@ static const AutoFormatEntry spChartSpaceLines[] =
     AUTOFORMAT_END()
 };
 
-static const AutoFormatEntry spChartSpaceFills[] =
-{
-    AUTOFORMAT_COLOR(  1, 32, THEMED_STYLE_SUBTLE, XML_bg1 ),
-    AUTOFORMAT_COLOR( 33, 40, THEMED_STYLE_SUBTLE, XML_lt1 ),
-    AUTOFORMAT_COLOR( 41, 48, THEMED_STYLE_SUBTLE, XML_dk1 ),
-    AUTOFORMAT_END()
-};
-
 static const AutoFormatEntry spPlotArea2dFills[] =
 {
     AUTOFORMAT_COLOR(       1, 32, THEMED_STYLE_SUBTLE, XML_bg1 ),
@@ -519,7 +511,7 @@ struct ObjectTypeFormatEntry
 static const ObjectTypeFormatEntry spObjTypeFormatEntries[] =
 {
     //                object type                property type              auto text          auto line            auto fill              auto effect
-    TYPEFORMAT_FRAME( OBJECTTYPE_CHARTSPACE,     PROPERTYTYPE_COMMON,       0,                 spChartSpaceLines,   spChartSpaceFills,     0 /* eq to Ch2 */ ),
+    TYPEFORMAT_FRAME( OBJECTTYPE_CHARTSPACE,     PROPERTYTYPE_COMMON,       0,                 spNoFormats,         spNoFormats,           0 /* eq to Ch2 */ ),
     TYPEFORMAT_FRAME( OBJECTTYPE_CHARTTITLE,     PROPERTYTYPE_COMMON,       spChartTitleTexts, 0 /* eq to Ch2 */,   0 /* eq to Ch2 */,     0 /* eq to Ch2 */ ),
     TYPEFORMAT_FRAME( OBJECTTYPE_LEGEND,         PROPERTYTYPE_COMMON,       spOtherTexts,      spNoFormats,         spNoFormats,           0 /* eq to Ch2 */ ),
     TYPEFORMAT_FRAME( OBJECTTYPE_PLOTAREA2D,     PROPERTYTYPE_COMMON,       0,                 0 /* eq to Ch2 */,   spPlotArea2dFills,     0 /* eq to Ch2 */ ),
@@ -544,7 +536,7 @@ static const ObjectTypeFormatEntry spObjTypeFormatEntries[] =
     TYPEFORMAT_LINE(  OBJECTTYPE_HILOLINE,       PROPERTYTYPE_LINEARSERIES, 0,                 spOtherLines ),
     TYPEFORMAT_FRAME( OBJECTTYPE_UPBAR,          PROPERTYTYPE_COMMON,       0,                 spUpDownBarLines,    spUpBarFills,          spUpDownBarEffects ),
     TYPEFORMAT_FRAME( OBJECTTYPE_DOWNBAR,        PROPERTYTYPE_COMMON,       0,                 spUpDownBarLines,    spDownBarFills,        spUpDownBarEffects ),
-    TYPEFORMAT_LINE(  OBJECTTYPE_DATATABLE,      PROPERTYTYPE_COMMON,       spOtherTexts,      spChartSpaceLines )
+    TYPEFORMAT_LINE(  OBJECTTYPE_DATATABLE,      PROPERTYTYPE_COMMON,       spOtherTexts,      spDataTableLines )
 };
 
 #undef TYPEFORMAT_FRAME
commit 9515c9073758dcdad311820de45c7424ad287a07
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Tue Jun 7 21:12:25 2011 -0700

    gcc 4.0 doesn't support the C++0x usage of enum::value
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index 44f050a..c9843e6 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -173,7 +173,7 @@ void FilterDetectDocHandler::parseRelationship( const AttributeList& rAttribs )
              Reference< com::sun::star::uri::XUriReference > xBase = xFac->parse( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("file:///" ) ) );
 
              Reference< com::sun::star::uri::XUriReference > xPart = xFac->parse(  rAttribs.getString( XML_Target, OUString() ) );
-             Reference< com::sun::star::uri::XUriReference > xAbs = xFac->makeAbsolute(  xBase, xPart, sal_True,  com::sun::star::uri::RelativeUriExcessParentSegments_RETAIN );
+             Reference< com::sun::star::uri::XUriReference > xAbs = xFac->makeAbsolute(  xBase, xPart, sal_True, com::sun::star::uri::RelativeUriExcessParentSegments_RETAIN );
 
              if ( xAbs.is() )
                  maTargetPath = xAbs->getPath();
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index d1f1d8c..7e1a390 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -201,7 +201,7 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess>
                     // file://base/word. We need something more than some
                     // simple string concatination here to handle that.
                     uno::Reference< com::sun::star::uri::XUriReference > xPart = xFac->parse(  sMyTarget );
-                    uno::Reference< com::sun::star::uri::XUriReference > xAbs = xFac->makeAbsolute(  xBase, xPart, sal_True,  com::sun::star::uri::RelativeUriExcessParentSegments::RelativeUriExcessParentSegments_RETAIN );
+                    uno::Reference< com::sun::star::uri::XUriReference > xAbs = xFac->makeAbsolute(  xBase, xPart, sal_True,  com::sun::star::uri::RelativeUriExcessParentSegments_RETAIN );
                     rDocumentTarget = xAbs->getPath();
                     // path will start with the fragment separator. need to
                     // remove that
commit 0b87c46a182a9fb15f5dbbdd2f00bde04c99e79b
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Tue Jun 7 20:59:21 2011 -0700

    The enum type name should be included when accessing the enum values.
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index 0857cf4..44f050a 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -173,7 +173,7 @@ void FilterDetectDocHandler::parseRelationship( const AttributeList& rAttribs )
              Reference< com::sun::star::uri::XUriReference > xBase = xFac->parse( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("file:///" ) ) );
 
              Reference< com::sun::star::uri::XUriReference > xPart = xFac->parse(  rAttribs.getString( XML_Target, OUString() ) );
-             Reference< com::sun::star::uri::XUriReference > xAbs = xFac->makeAbsolute(  xBase, xPart, sal_True,  com::sun::star::uri::RelativeUriExcessParentSegments::RelativeUriExcessParentSegments_RETAIN );
+             Reference< com::sun::star::uri::XUriReference > xAbs = xFac->makeAbsolute(  xBase, xPart, sal_True,  com::sun::star::uri::RelativeUriExcessParentSegments_RETAIN );
 
              if ( xAbs.is() )
                  maTargetPath = xAbs->getPath();
commit 67f661f7d07ee319e3d4b435e07a33aea5baaab7
Author: Noel Power <noel.power at novell.com>
Date:   Tue Jun 7 19:04:40 2011 +0100

    fix for bnc#693386
    
    properly handle relative Uri(s) in Target
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/oox/inc/oox/core/filterdetect.hxx b/oox/inc/oox/core/filterdetect.hxx
index fb444fa..2a336bf 100644
--- a/oox/inc/oox/core/filterdetect.hxx
+++ b/oox/inc/oox/core/filterdetect.hxx
@@ -59,7 +59,7 @@ namespace core {
 class FilterDetectDocHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XFastDocumentHandler >
 {
 public:
-    explicit            FilterDetectDocHandler( ::rtl::OUString& rFilter );
+    explicit            FilterDetectDocHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, ::rtl::OUString& rFilter );
     virtual             ~FilterDetectDocHandler();
 
     // XFastDocumentHandler
@@ -91,6 +91,7 @@ private:
     ::rtl::OUString&    mrFilterName;
     ContextVector       maContextStack;
     ::rtl::OUString     maTargetPath;
+    ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
 };
 
 // ============================================================================
@@ -167,4 +168,4 @@ private:
 
 #endif
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index 568634f..0857cf4 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -39,6 +39,7 @@
 #include "oox/helper/binaryoutputstream.hxx"
 #include "oox/helper/zipstorage.hxx"
 #include "oox/ole/olestorage.hxx"
+#include <com/sun/star/uri/UriReferenceFactory.hpp>
 
 namespace oox {
 namespace core {
@@ -57,8 +58,8 @@ using ::rtl::OUString;
 
 // ============================================================================
 
-FilterDetectDocHandler::FilterDetectDocHandler( OUString& rFilterName ) :
-    mrFilterName( rFilterName )
+FilterDetectDocHandler::FilterDetectDocHandler( const  Reference< XComponentContext >& rxContext, OUString& rFilterName ) :
+    mrFilterName( rFilterName ), mxContext( rxContext )
 {
     maContextStack.reserve( 2 );
 }
@@ -163,7 +164,24 @@ void FilterDetectDocHandler::parseRelationship( const AttributeList& rAttribs )
 {
     OUString aType = rAttribs.getString( XML_Type, OUString() );
     if( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ) ) )
-        maTargetPath = OUString( sal_Unicode( '/' ) ) + rAttribs.getString( XML_Target, OUString() );
+    {
+        Reference< com::sun::star::uri::XUriReferenceFactory > xFac =  com::sun::star::uri::UriReferenceFactory::create( mxContext );
+        try
+        {
+             // use '/' to representent the root of the zip package ( and provide a 'file' scheme to
+             // keep the XUriReference implementation happy )
+             Reference< com::sun::star::uri::XUriReference > xBase = xFac->parse( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("file:///" ) ) );
+
+             Reference< com::sun::star::uri::XUriReference > xPart = xFac->parse(  rAttribs.getString( XML_Target, OUString() ) );
+             Reference< com::sun::star::uri::XUriReference > xAbs = xFac->makeAbsolute(  xBase, xPart, sal_True,  com::sun::star::uri::RelativeUriExcessParentSegments::RelativeUriExcessParentSegments_RETAIN );
+
+             if ( xAbs.is() )
+                 maTargetPath = xAbs->getPath();
+        }
+        catch( Exception& e)
+        {
+        }
+    }
 }
 
 OUString FilterDetectDocHandler::getFilterNameFromContentType( const OUString& rContentType ) const
@@ -663,7 +681,7 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq
             aParser.registerNamespace( NMSP_packageRel );
             aParser.registerNamespace( NMSP_officeRel );
             aParser.registerNamespace( NMSP_packageContentTypes );
-            aParser.setDocumentHandler( new FilterDetectDocHandler( aFilterName ) );
+            aParser.setDocumentHandler( new FilterDetectDocHandler( mxContext, aFilterName ) );
 
             /*  Parse '_rels/.rels' to get the target path and '[Content_Types].xml'
                 to determine the content type of the part at the target path. */
@@ -671,7 +689,7 @@ OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq
             aParser.parseStream( aZipStorage, CREATE_OUSTRING( "[Content_Types].xml" ) );
         }
     }
-    catch( Exception& )
+    catch( Exception& e )
     {
     }
 
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index ba48c20..d1f1d8c 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -32,6 +32,7 @@
 #include <iostream>
 
 #include <com/sun/star/embed/XHierarchicalStorageAccess.hpp>
+#include <com/sun/star/uri/UriReferenceFactory.hpp>
 
 //#define DEBUG_STREAM
 
@@ -100,6 +101,11 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess>
                                     ::rtl::OUString & rDocumentTarget)
 {
     bool bFound = false;
+    static uno::Reference< com::sun::star::uri::XUriReferenceFactory > xFac =  ::com::sun::star::uri::UriReferenceFactory::create( mxContext );
+    // use '/' to representent the root of the zip package ( and provide a 'file' scheme to
+    // keep the XUriReference implementation happy )
+    // add mspath to represent the 'source' of this stream
+    uno::Reference< com::sun::star::uri::XUriReference > xBase = xFac->parse( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("file:///" ) ) + msPath );
 
     static rtl::OUString sType(RTL_CONSTASCII_USTRINGPARAM("Type"));
     static rtl::OUString sId(RTL_CONSTASCII_USTRINGPARAM("Id"));
@@ -190,8 +196,16 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess>
                     rDocumentTarget = sMyTarget;
                 else
                 {
-                    rDocumentTarget = msPath;
-                    rDocumentTarget += sMyTarget;
+                    // 'Target' is a relative Uri, so a 'Target=/path'
+                    // with a base Uri of file://base/foo will resolve to
+                    // file://base/word. We need something more than some
+                    // simple string concatination here to handle that.
+                    uno::Reference< com::sun::star::uri::XUriReference > xPart = xFac->parse(  sMyTarget );
+                    uno::Reference< com::sun::star::uri::XUriReference > xAbs = xFac->makeAbsolute(  xBase, xPart, sal_True,  com::sun::star::uri::RelativeUriExcessParentSegments::RelativeUriExcessParentSegments_RETAIN );
+                    rDocumentTarget = xAbs->getPath();
+                    // path will start with the fragment separator. need to
+                    // remove that
+                    rDocumentTarget = rDocumentTarget.copy( 1 );
                 }
                 
                 break;
commit ce13dc1ac0f8ce6b6189bed53e8c60ede521dcf6
Author: Thorsten Behrens <tbehrens at novell.com>
Date:   Tue Jul 5 14:06:22 2011 +0200

    Fix label position for ooxml charts
    
    Fixes bnc#694340 somewhat hackish - chart2 cannot individually place
    chart data labels, so if the original ooxml document does, attempt
    one of the canned position as an approximation.
    
    Signed-off-by: Andras Timar <atimar at suse.com>

diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index bb1479f..7b3d266 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -35,6 +35,7 @@
 #include <com/sun/star/chart2/XRegressionCurve.hpp>
 #include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
 #include <com/sun/star/chart2/data/XDataSink.hpp>
+#include <basegfx/numeric/ftools.hxx>
 #include "oox/drawingml/chart/datasourceconverter.hxx"
 #include "oox/drawingml/chart/seriesmodel.hxx"
 #include "oox/drawingml/chart/titleconverter.hxx"
@@ -59,6 +60,15 @@ using ::rtl::OUString;
 
 namespace {
 
+/** nastied-up sgn function - employs some gratuity around 0 - values
+   smaller than 0.33 are clamped to 0
+ */
+int lclSgn( double nVal )
+{
+    const int intVal=nVal*3;
+    return intVal == 0 ? 0 : (intVal < 0 ? -1 : 1);
+}
+
 Reference< XLabeledDataSequence > lclCreateLabeledDataSequence(
         const ConverterRoot& rParent,
         DataSourceModel* pValues, const OUString& rRole,
@@ -178,6 +188,27 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat
     {
         PropertySet aPropSet( rxDataSeries->getDataPointByIndex( mrModel.mnIndex ) );
         lclConvertLabelFormatting( aPropSet, getFormatter(), mrModel, rTypeGroup, false );
+
+        if( !mrModel.mxLayout->mbAutoLayout )
+        {
+            // bnc#694340 - nasty hack - chart2 cannot individually
+            // place data labels, let's try to find a useful
+            // compromise instead
+            namespace csscd = ::com::sun::star::chart::DataLabelPlacement;
+            const sal_Int32 aPositionsLookupTable[] =
+                {
+                    csscd::TOP_LEFT,    csscd::TOP,    csscd::TOP_RIGHT,
+                    csscd::LEFT,        csscd::CENTER, csscd::RIGHT,
+                    csscd::BOTTOM_LEFT, csscd::BOTTOM, csscd::BOTTOM_RIGHT
+                };
+            const double nMax=std::max(
+                fabs(mrModel.mxLayout->mfX),
+                fabs(mrModel.mxLayout->mfY));
+            const int simplifiedX=lclSgn(mrModel.mxLayout->mfX/nMax);
+            const int simplifiedY=lclSgn(mrModel.mxLayout->mfY/nMax);
+            aPropSet.setProperty( PROP_LabelPlacement,
+                                  aPositionsLookupTable[ simplifiedX+1 + 3*(simplifiedY+1) ] );
+        }
     }
     catch( Exception& )
     {
commit 9d2857aecf635728f05beeff6f3c16a20e960509
Author: marc-andre at atc.tcs.com <marc-andre at atc.tcs.com>
Date:   Wed Jul 6 12:49:14 2011 +0530

    Added pointer validations to avoid some edge-case documents crashing
    (cherry picked from commit e3d3d88ccc959fc30d1d93bf1b6273f8d4f5b25a)

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index a1c55c7..d9df588 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4672,7 +4672,7 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
                     aRecHd2.SeekToBegOfRecord( rSt );
                     sal_Int32 nShapeId;
                     SdrObject* pTmp = ImportGroup( aRecHd2, rSt, pClientData, aGroupClientAnchor, aGroupChildAnchor, nCalledByGroup + 1, &nShapeId );
-                    if ( pTmp )
+                    if ( pTmp && pRet && ((SdrObjGroup*)pRet)->GetSubList() )
                     {
                         ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
                         if( nShapeId )
@@ -4684,7 +4684,7 @@ SdrObject* SvxMSDffManager::ImportGroup( const DffRecordHeader& rHd, SvStream& r
                     aRecHd2.SeekToBegOfRecord( rSt );
                     sal_Int32 nShapeId;
                     SdrObject* pTmp = ImportShape( aRecHd2, rSt, pClientData, aClientRect, aGlobalChildRect, nCalledByGroup + 1, &nShapeId );
-                    if ( pTmp )
+                    if ( pTmp && pRet && ((SdrObjGroup*)pRet)->GetSubList())
                     {
                         ((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
                         if( nShapeId )


More information about the Libreoffice-commits mailing list