Commits

Anonymous committed a6c30a3 Merge

sb140: merged in DEV300_m103

Comments (0)

Files changed (508)

 20c5c9384888da33596d864251881e6e46bdd339 DEV300_m100
 564e24baaaae5e18c8bfa76811993fbefa571b5c DEV300_m101
 7dbaa615ad894cfd4f9611e82783250bd0a3016d DEV300_m102
+1bdfec44e7ce902365aa7d9cb632f0adeb86262e DEV300_m103

basic/source/basmgr/basmgr.cxx

     sCall += ']';
 
 	SbxVariable* pRet = pMethod->GetParent()->Execute( sCall );
-    if ( pRet )
+    if ( pRet && ( pRet != pMethod ) )
         *i_retValue = *pRet;
     return SbxBase::GetError();
 }

basic/source/classes/sbxmod.cxx

 #include <svl/brdcst.hxx>
 #include <tools/shl.hxx>
 #include <basic/sbx.hxx>
+#include "sbdiagnose.hxx"
 #include "sb.hxx"
 #include <sbjsmeth.hxx>
 #include "sbjsmod.hxx"
 
 		        GlobalRunDeInit();
 
+#ifdef DBG_UTIL
+                ResetCapturedAssertions();
+#endif
+
                 // VBA always ensures screenupdating is enabled after completing
                 if ( mbVBACompat )
                     VBAUnlockDocuments( PTR_CAST( StarBASIC, GetParent() ) );

basic/source/inc/sbdiagnose.hxx

+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2011 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef BASIC_SBDIAGNOSE_HXX
+#define BASIC_SBDIAGNOSE_HXX
+
+#ifdef DBG_UTIL
+void    ResetCapturedAssertions();
+#endif
+
+#endif // BASIC_SBDIAGNOSE_HXX

basic/source/runtime/makefile.mk

 	$(SLO)$/methods1.obj	\
 	$(SLO)$/props.obj	\
 	$(SLO)$/ddectrl.obj	\
-	$(SLO)$/dllmgr.obj
+	$(SLO)$/dllmgr.obj \
+	$(SLO)$/sbdiagnose.obj
 
 .IF "$(GUI)$(COM)$(CPU)" == "WNTMSCI"
 SLOFILES+=	$(SLO)$/wnt.obj

basic/source/runtime/rtlproto.hxx

 extern RTLFUNC(CDateFromIso);
 extern RTLFUNC(CompatibilityMode);
 extern RTLFUNC(CDec);
+extern RTLFUNC(CaptureAssertions);
 
 extern RTLFUNC(Partition); // Fong
 

basic/source/runtime/sbdiagnose.cxx

+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2011 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_basic.hxx"
+
+#include "rtlproto.hxx"
+#include "sbdiagnose.hxx"
+
+#include "basic/sbstar.hxx"
+
+#include <tools/debug.hxx>
+#include <comphelper/flagguard.hxx>
+
+#ifdef DBG_UTIL
+
+static DbgChannelId nRestoreChannelId = 0;
+static DbgChannelId nAssertionChannelId = 0;
+static StarBASICRef xAssertionChannelBasic;
+static String sCaptureFunctionName;
+static bool bReportingAssertion = false;
+
+void ResetCapturedAssertions()
+{
+	if ( nRestoreChannelId != 0 )
+	{
+		DBG_INSTOUTERROR( nRestoreChannelId );
+	}
+    nRestoreChannelId = 0;
+    xAssertionChannelBasic = NULL;
+    sCaptureFunctionName = String();
+    bReportingAssertion = false;
+}
+
+void DbgReportAssertion( const sal_Char* i_assertionMessage )
+{
+    if ( !xAssertionChannelBasic )
+    {
+        ResetCapturedAssertions();
+        return;
+    }
+
+    // prevent infinite recursion
+    if ( bReportingAssertion )
+        return;
+    ::comphelper::FlagRestorationGuard aGuard( bReportingAssertion, true );
+
+	SbxArrayRef const xArguments( new SbxArray( SbxVARIANT ) );
+	SbxVariableRef const xMessageText = new SbxVariable( SbxSTRING );
+    xMessageText->PutString( String::CreateFromAscii( i_assertionMessage ) );
+    xArguments->Put( xMessageText, 1 );
+
+    ErrCode const nError = xAssertionChannelBasic->Call( sCaptureFunctionName, xArguments );
+    if ( ( nError & SbERR_METHOD_NOT_FOUND ) != 0 )
+        ResetCapturedAssertions();
+}
+
+#endif
+
+/// capture assertions, route them to the given given Basic function
+RTLFUNC(CaptureAssertions)
+{
+    (void)bWrite;
+
+    // need exactly one argument
+	if ( rPar.Count() != 2 )
+	{
+		StarBASIC::Error( SbERR_BAD_ARGUMENT );
+		return;
+	}
+
+#ifdef DBG_UTIL
+    DBG_TESTSOLARMUTEX();
+
+    String const sFunctionName = rPar.Get(1)->GetString();
+    if ( sFunctionName.Len() == 0 )
+    {
+        ResetCapturedAssertions();
+        return;
+    }
+
+    if ( nAssertionChannelId == 0 )
+    {
+        // TODO: should we register a named channel at the VCL API, instead of an unnamed channel at the tools API?
+        // A named channel would mean it would appear in the nonpro-debug-options dialog
+        nAssertionChannelId = DbgRegisterUserChannel( &DbgReportAssertion );
+    }
+
+    DbgChannelId const nCurrentChannelId = (DbgChannelId)DbgGetErrorOut();
+    if ( nCurrentChannelId != nAssertionChannelId )
+    {
+        // remember the current channel
+        nRestoreChannelId = nCurrentChannelId;
+
+        // set the new channel
+        DBG_INSTOUTERROR( nAssertionChannelId );
+
+        // ensure OSL assertions are captured, too
+        DbgData aData( *DbgGetData() );
+        aData.bHookOSLAssert = sal_True;
+        DbgUpdateOslHook( &aData );
+    }
+
+    xAssertionChannelBasic = pBasic;
+    sCaptureFunctionName = sFunctionName;
+#else
+    (void)pBasic;
+    (void)rPar;
+    (void)bWrite;
+#endif
+}
+

basic/source/runtime/stdobj.cxx

   { "number",       SbxDOUBLE, 0,NULL,0 },
 { "CreateObject",   SbxOBJECT,    1 | _FUNCTION, RTLNAME( CreateObject ),0  },
   { "class",        SbxSTRING, 0,NULL,0 },
+{ "CaptureAssertions",  SbxNULL, 1 | _FUNCTION, RTLNAME(CaptureAssertions), 0 },
+  { "methodName",   SbxSTRING, 0, NULL, 0 },
 { "CreateUnoListener",SbxOBJECT,   1 | _FUNCTION, RTLNAME( CreateUnoListener ),0 },
   { "prefix",  SbxSTRING, 0,NULL,0 },
   { "typename",  SbxSTRING, 0,NULL,0 },

chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx

         }
         break;
 
+        case EE_CHAR_OVERLINE:
+        {
+            SvxOverlineItem aItem( UNDERLINE_NONE, EE_CHAR_OVERLINE );
+            bool bModified = false;
+
+            uno::Any aValue( GetPropertySet()->getPropertyValue( C2U( "CharOverline" ) ) );
+            if ( aValue.hasValue() )
+            {
+                aItem.PutValue( aValue, MID_TL_STYLE );
+                bModified = true;
+            }
+
+            aValue = GetPropertySet()->getPropertyValue( C2U( "CharOverlineHasColor" ) );
+            if ( aValue.hasValue() &&
+                 ( *reinterpret_cast< const sal_Bool* >( aValue.getValue() ) != sal_False ) )
+            {
+                aItem.PutValue( aValue, MID_TL_HASCOLOR );
+                bModified = true;
+            }
+
+            aValue = GetPropertySet()->getPropertyValue( C2U( "CharOverlineColor" ) );
+            if ( aValue.hasValue() )
+            {
+                aItem.PutValue( aValue, MID_TL_COLOR );
+                bModified = true;
+            }
+
+            if ( bModified )
+            {
+                rOutItemSet.Put( aItem );
+            }
+        }
+        break;
+
         case EE_CHAR_ITALIC:
         case EE_CHAR_ITALIC_CJK:
         case EE_CHAR_ITALIC_CTL:
         }
         break;
 
+        case EE_CHAR_OVERLINE:
+        {
+            const SvxOverlineItem& rItem = static_cast< const SvxOverlineItem & >( rItemSet.Get( nWhichId ) );
+
+            if ( rItem.QueryValue( aValue, MID_TL_STYLE ) )
+            {
+                if ( aValue != GetPropertySet()->getPropertyValue( C2U( "CharOverline" ) ) )
+                {
+                    GetPropertySet()->setPropertyValue( C2U( "CharOverline" ), aValue );
+                    bChanged = true;
+                }
+            }
+
+            if ( rItem.QueryValue( aValue, MID_TL_COLOR ) )
+            {
+                if ( aValue != GetPropertySet()->getPropertyValue( C2U( "CharOverlineColor" ) ) )
+                {
+                    GetPropertySet()->setPropertyValue( C2U( "CharOverlineColor" ), aValue );
+                    bChanged = true;
+                }
+            }
+
+            if ( rItem.QueryValue( aValue, MID_TL_HASCOLOR ) )
+            {
+                if ( aValue != GetPropertySet()->getPropertyValue( C2U( "CharOverlineHasColor" ) ) )
+                {
+                    GetPropertySet()->setPropertyValue( C2U( "CharOverlineHasColor" ), aValue );
+                    bChanged = true;
+                }
+            }
+        }
+        break;
+
         case EE_CHAR_ITALIC:
         case EE_CHAR_ITALIC_CJK:
         case EE_CHAR_ITALIC_CTL:

chart2/source/controller/main/ChartController_Position.cxx

 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
-void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, Rectangle& rPosAndSize, const awt::Size aOriginalSize )
+void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, awt::Rectangle& rPosAndSize, const awt::Size aOriginalSize )
 {
     long nPosX(0);
 	long nPosY(0);
             break;
     }
 
-	rPosAndSize = Rectangle(Point(nPosX,nPosY),Size(nSizX,nSizY));
+    rPosAndSize = awt::Rectangle(nPosX,nPosY,nSizX,nSizY);
 }
 
 void SAL_CALL ChartController::executeDispatch_PositionAndSize()
             const SfxItemSet* pOutItemSet = pDlg->GetOutputItemSet();
             if(pOutItemSet)
             {
-                Rectangle aObjectRect;
+                awt::Rectangle aObjectRect;
                 aItemSet.Put(*pOutItemSet);//overwrite old values with new values (-> all items are set)
                 lcl_getPositionAndSizeFromItemSet( aItemSet, aObjectRect, aSelectedSize );
                 awt::Size aPageSize( ChartModelHelper::getPageSize( getModel() ) );
-                Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height );
+                awt::Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height );
 
                 bool bChanged = false;    
                 if ( eObjectType == OBJECTTYPE_LEGEND )
                     bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( getModel(), false , true );
 
                 bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID(), getModel()
-                            , awt::Rectangle(aObjectRect.getX(),aObjectRect.getY(),aObjectRect.getWidth(),aObjectRect.getHeight())
-                            , awt::Rectangle(aPageRect.getX(),aPageRect.getY(),aPageRect.getWidth(),aPageRect.getHeight()) );
+                            , aObjectRect, aPageRect );
                 if( bMoved || bChanged )
                     aUndoGuard.commit();
             }

chart2/source/controller/main/ChartController_Window.cxx

 
     if ( bSuccess )
     {
+        ::vos::OGuard aGuard( Application::GetSolarMutex() );
+        if ( m_pDrawViewWrapper && m_pDrawViewWrapper->IsTextEdit() )
+        {
+            this->EndTextEdit();
+        }
         this->impl_selectObjectAndNotiy();
+        if ( m_pChartWindow )
+        {
+            m_pChartWindow->Invalidate();
+        }
         return sal_True;
     }
 

chart2/source/inc/CharacterProperties.hxx

         PROP_CHAR_UNDERLINE,
         PROP_CHAR_UNDERLINE_COLOR,
         PROP_CHAR_UNDERLINE_HAS_COLOR,
+        PROP_CHAR_OVERLINE,
+        PROP_CHAR_OVERLINE_COLOR,
+        PROP_CHAR_OVERLINE_HAS_COLOR,
         PROP_CHAR_WEIGHT,
         PROP_CHAR_POSTURE,
         PROP_CHAR_AUTO_KERNING,

chart2/source/inc/ExponentialRegressionCurveCalculator.hxx

         throw (::com::sun::star::lang::IllegalArgumentException,
                ::com::sun::star::uno::RuntimeException);
 
-    // formula is: f(x) = m_fSlope ^ x + m_fIntercept
-    double m_fSlope;
-    double m_fIntercept;
+    // formula is: f(x) = exp(m_fLogIntercept) * exp( m_fLogSlope * x )
+    // mathematical model f(x) = Intercept * Slope^x
+    double m_fLogSlope;
+    double m_fLogIntercept;
 };
 
 } //  namespace chart

chart2/source/model/main/Diagram.cxx

         ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, true );
         ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false );
         ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 );
+        ::chart::SceneProperties::AddDefaultsToMap( rOutMap );
     }    
 };
 

chart2/source/tools/CharacterProperties.cxx

                   ::getBooleanCppuType(),
                   beans::PropertyAttribute::BOUND
                   | beans::PropertyAttribute::MAYBEDEFAULT ));
+    // CharOverline (see awt.FontUnderline)
+    rOutProperties.push_back(
+        Property( C2U( "CharOverline" ),
+                  PROP_CHAR_OVERLINE,
+                  ::getCppuType( reinterpret_cast< const sal_Int16* >( 0 ) ),
+                  beans::PropertyAttribute::BOUND
+                  | beans::PropertyAttribute::MAYBEDEFAULT ) );
+    // CharOverlineColor
+    rOutProperties.push_back(
+        Property( C2U( "CharOverlineColor" ),
+                  PROP_CHAR_OVERLINE_COLOR,
+                  ::getCppuType( reinterpret_cast< const sal_Int32* >( 0 ) ),
+                  beans::PropertyAttribute::BOUND
+                  | beans::PropertyAttribute::MAYBEDEFAULT
+                  | beans::PropertyAttribute::MAYBEVOID ) );
+    // CharOverlineHasColor
+    rOutProperties.push_back(
+        Property( C2U( "CharOverlineHasColor" ),
+                  PROP_CHAR_OVERLINE_HAS_COLOR,
+                  ::getBooleanCppuType(),
+                  beans::PropertyAttribute::BOUND
+                  | beans::PropertyAttribute::MAYBEDEFAULT ) );
     // CharWeight (see awt.FontWeight)
     rOutProperties.push_back(
         Property( C2U( "CharWeight" ),
     ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE, awt::FontUnderline::NONE );
     ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_UNDERLINE_COLOR, -1 ); //automatic color (COL_AUTO)
     ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE_HAS_COLOR, false );
+    ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE, awt::FontUnderline::NONE );
+    ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_OVERLINE_COLOR, -1 ); //automatic color (COL_AUTO)
+    ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE_HAS_COLOR, false );
     ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_WEIGHT, awt::FontWeight::NORMAL );
     ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_POSTURE, awt::FontSlant_NONE );
     ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_AUTO_KERNING, true );

chart2/source/tools/ExponentialRegressionCurveCalculator.cxx

 {
 
 ExponentialRegressionCurveCalculator::ExponentialRegressionCurveCalculator() :
-        m_fSlope( 0.0 ),
-        m_fIntercept( 0.0 )
+        m_fLogSlope( 0.0 ),
+        m_fLogIntercept( 0.0 )
 {
-    ::rtl::math::setNan( & m_fSlope );
-    ::rtl::math::setNan( & m_fIntercept );
+    ::rtl::math::setNan( & m_fLogSlope );
+    ::rtl::math::setNan( & m_fLogIntercept );
 }
 
 ExponentialRegressionCurveCalculator::~ExponentialRegressionCurveCalculator()
     const size_t nMax = aValues.first.size();
     if( nMax == 0 )
     {
-        ::rtl::math::setNan( & m_fSlope );
-        ::rtl::math::setNan( & m_fIntercept );
-        ::rtl::math::setNan( & m_fCorrelationCoeffitient );
+        ::rtl::math::setNan( & m_fLogSlope );
+        ::rtl::math::setNan( & m_fLogIntercept );
+        ::rtl::math::setNan( & m_fCorrelationCoeffitient );// actual it is coefficient of determination
         return;
     }
 
         fQxy += fDeltaX * fDeltaY;
     }
 
-    m_fSlope = fQxy / fQx;
-    m_fIntercept = fAverageY - m_fSlope * fAverageX;
+    m_fLogSlope = fQxy / fQx;
+    m_fLogIntercept = fAverageY - m_fLogSlope * fAverageX;
     m_fCorrelationCoeffitient = fQxy / sqrt( fQx * fQy );
 
-    m_fSlope = exp( m_fSlope );
-    m_fIntercept = exp( m_fIntercept );
 }
 
 double SAL_CALL ExponentialRegressionCurveCalculator::getCurveValue( double x )
     double fResult;
     ::rtl::math::setNan( & fResult );
 
-    if( ! ( ::rtl::math::isNan( m_fSlope ) ||
-            ::rtl::math::isNan( m_fIntercept )))
+    if( ! ( ::rtl::math::isNan( m_fLogSlope ) ||
+            ::rtl::math::isNan( m_fLogIntercept )))
     {
-        fResult = m_fIntercept * pow( m_fSlope, x );
+        fResult = exp(m_fLogIntercept + x * m_fLogSlope);
     }
 
     return fResult;
     const uno::Reference< util::XNumberFormatter >& xNumFormatter,
     ::sal_Int32 nNumberFormatKey ) const
 {
+    double fIntercept = exp(m_fLogIntercept);
+    double fSlope = exp(m_fLogSlope);
+    bool bHasSlope = !rtl::math::approxEqual( fSlope, 1.0 );
+    bool bHasIntercept = !rtl::math::approxEqual( fIntercept, 1.0 );
+    
     OUStringBuffer aBuf( C2U( "f(x) = " ));
 
-    if( m_fIntercept == 0.0 ||
-        m_fSlope == 0.0 )
+    if ( fIntercept == 0.0)
     {
-        aBuf.append( sal_Unicode( '0' ));
-    }
-    else if( rtl::math::approxEqual( m_fSlope, 1.0 ) )
-    {
-        aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fIntercept ));
+        // underflow, a true zero is impossible
+        aBuf.append( C2U( "exp( " ));
+        aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogIntercept) );
+        aBuf.append( (m_fLogSlope < 0.0) ? C2U( " - " ) : C2U( " + " ));
+        aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, fabs(m_fLogSlope)) );
+        aBuf.append( C2U( " x )" ));
     }
     else
     {
-        if( ! rtl::math::approxEqual( m_fIntercept, 1.0 ) )
+        if (bHasIntercept)
         {
-            aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fIntercept ));
-            aBuf.append( sal_Unicode( 0x00b7 ));
+            aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, fIntercept) );
+            aBuf.append( C2U( " exp( " ));
+            aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogSlope) );
+            aBuf.append( C2U( " x )" ));
         }
-
-        if( m_fSlope < 0.0 )
-            aBuf.append( sal_Unicode( '(' ));
-        aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope ));
-        if( m_fSlope < 0.0 )
-            aBuf.append( sal_Unicode( ')' ));
-        aBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "^x" ));
+        else
+        {
+            // show logarithmic output, if intercept and slope both are near one
+            // otherwise drop output of intercept, which is 1 here
+            aBuf.append( C2U( " exp( " ));
+            if (!bHasSlope)
+            {
+                aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogIntercept) );
+                aBuf.append( (m_fLogSlope < 0.0) ? C2U( " - " ) : C2U( " + " ));
+                aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, fabs(m_fLogSlope)) );
+            }
+            else
+            {
+                aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fLogSlope) );
+            }
+            aBuf.append( C2U( " x )" ));
+        }
     }
 
     return aBuf.makeStringAndClear();

chart2/source/view/axes/ScaleAutomatism.cxx

 using ::com::sun::star::chart::TimeUnit::YEAR;
 
 const sal_Int32 MAXIMUM_MANUAL_INCREMENT_COUNT = 500;
-const sal_Int32 MAXIMUM_AUTO_INCREMENT_COUNT = 10;
 const sal_Int32 MAXIMUM_SUB_INCREMENT_COUNT = 100;
 
+sal_Int32 lcl_getMaximumAutoIncrementCount( sal_Int32 nAxisType )
+{
+    sal_Int32 nMaximumAutoIncrementCount = 10;
+    if( nAxisType==AxisType::DATE )
+        nMaximumAutoIncrementCount = MAXIMUM_MANUAL_INCREMENT_COUNT;
+    return nMaximumAutoIncrementCount;
+}
+
 namespace
 {
 
                     : m_aSourceScale( rSourceScale )
                     , m_fValueMinimum( 0.0 )
                     , m_fValueMaximum( 0.0 )
-                    , m_nMaximumAutoMainIncrementCount( MAXIMUM_AUTO_INCREMENT_COUNT )
+                    , m_nMaximumAutoMainIncrementCount( lcl_getMaximumAutoIncrementCount( rSourceScale.AxisType ) )
                     , m_bExpandBorderToIncrementRhythm( false )
                     , m_bExpandIfValuesCloseToBorder( false )
                     , m_bExpandWideValuesToZero( false )
 {
     if( nMaximumAutoMainIncrementCount < 2 )
         m_nMaximumAutoMainIncrementCount = 2; //#i82006
-    else if( nMaximumAutoMainIncrementCount > MAXIMUM_AUTO_INCREMENT_COUNT )
-        m_nMaximumAutoMainIncrementCount = MAXIMUM_AUTO_INCREMENT_COUNT;
+    else if( nMaximumAutoMainIncrementCount > lcl_getMaximumAutoIncrementCount( m_aSourceScale.AxisType ) )
+        m_nMaximumAutoMainIncrementCount = lcl_getMaximumAutoIncrementCount( m_aSourceScale.AxisType );
     else
         m_nMaximumAutoMainIncrementCount = nMaximumAutoMainIncrementCount;
 }
         nNumer = static_cast<sal_Int32>( rtl::math::approxCeil( nIntervalDays/nDaysPerInterval ) );
         if(nNumer<=0)
             nNumer=1;
+        if( rExplicitIncrement.MajorTimeInterval.TimeUnit == DAY )
+        {
+            if( nNumer>2 && nNumer<7 )
+                nNumer=7;
+            else if( nNumer>7 )
+            {
+                rExplicitIncrement.MajorTimeInterval.TimeUnit = MONTH;
+                nDaysPerInterval = 31.0;
+                nNumer = static_cast<sal_Int32>( rtl::math::approxCeil( nIntervalDays/nDaysPerInterval ) );
+                if(nNumer<=0)
+                    nNumer=1;
+            }
+        }
         rExplicitIncrement.MajorTimeInterval.Number = nNumer;
         nMainIncrementCount = nDayCount/(nNumer*nDaysPerInterval);
     }

chart2/source/view/charttypes/VSeriesPlotter.cxx

             if( xTextShape.is())
             {
                 ShapeFactory::setShapeName( xTextShape, rEquationCID );
-                xTextShape->setPosition(
-                    RelativePositionHelper::getUpperLeftCornerOfAnchoredObject(
-                        aScreenPosition2D, xTextShape->getSize(), aRelativePosition.Anchor ));
+                awt::Size aSize( xTextShape->getSize() );
+                awt::Point aPos( RelativePositionHelper::getUpperLeftCornerOfAnchoredObject(
+                    aScreenPosition2D, aSize, aRelativePosition.Anchor ) );
+                //ensure that the equation is fully placed within the page (if possible)
+                if( (aPos.X + aSize.Width) > m_aPageReferenceSize.Width )
+                    aPos.X = m_aPageReferenceSize.Width - aSize.Width;
+                if( aPos.X < 0 )
+                    aPos.X = 0;
+                if( (aPos.Y + aSize.Height) > m_aPageReferenceSize.Height )
+                    aPos.Y = m_aPageReferenceSize.Height - aSize.Height;
+                if( aPos.Y < 0 )
+                    aPos.Y = 0;
+                xTextShape->setPosition(aPos);
             }
         }
     }

chart2/source/view/main/ChartView.cxx

     }
 
     uno::Reference< XTitle > xTitle( TitleHelper::getTitle( eType, xChartModel ) );
-    if(xTitle.is())
+    rtl::OUString aCompleteString( TitleHelper::getCompleteString( xTitle ) );
+    if( aCompleteString.getLength() != 0 )
     {
-        rtl::OUString aCompleteString( TitleHelper::getCompleteString( xTitle ) );
-        if ( aCompleteString.getLength() == 0 )
-            return apVTitle;//don't create empty titles as the resulting diagram position is wrong then
-
         //create title
         apVTitle = std::auto_ptr<VTitle>(new VTitle(xTitle));
         rtl::OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, xChartModel ) );

chart2/source/view/main/PropertyMapper.cxx

         ( C2U( "CharUnderline" ),           C2U("CharUnderline") )
         ( C2U( "CharUnderlineColor" ),      C2U("CharUnderlineColor") )
         ( C2U( "CharUnderlineHasColor" ),   C2U("CharUnderlineHasColor") )
+        ( C2U( "CharOverline" ),            C2U("CharOverline") )
+        ( C2U( "CharOverlineColor" ),       C2U("CharOverlineColor") )
+        ( C2U( "CharOverlineHasColor" ),    C2U("CharOverlineHasColor") )
         ( C2U( "CharWeight" ),              C2U("CharWeight") )
         ( C2U( "CharWeightAsian" ),         C2U("CharWeightAsian") )
         ( C2U( "CharWeightComplex" ),       C2U("CharWeightComplex") )

chart2/source/view/main/VLegend.cxx

                     RelativeSize aRelativeSize;
                     if ((xLegendProp->getPropertyValue( C2U( "RelativeSize" )) >>= aRelativeSize))
                     {
-                        aLegendSize.Width = aRelativeSize.Primary * rPageSize.Width;
-                        aLegendSize.Height = aRelativeSize.Secondary * rPageSize.Height;               
+                        aLegendSize.Width = ::rtl::math::approxCeil( aRelativeSize.Primary * rPageSize.Width );
+                        aLegendSize.Height = ::rtl::math::approxCeil( aRelativeSize.Secondary * rPageSize.Height );
                     }
                     else
                         eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH;                  

cppu/source/typelib/typelib.cxx

 		delete pWeakMap;
 		pWeakMap = 0;
 	}
-#if OSL_DEBUG_LEVEL > 1
-	OSL_ASSERT(	nTypeDescriptionCount == 0 );
-	OSL_ASSERT(	nCompoundTypeDescriptionCount == 0 );
-	OSL_ASSERT(	nUnionTypeDescriptionCount == 0 );
-	OSL_ASSERT(	nIndirectTypeDescriptionCount == 0 );
-	OSL_ASSERT(	nArrayTypeDescriptionCount == 0 );
-	OSL_ASSERT(	nEnumTypeDescriptionCount == 0 );
-	OSL_ASSERT(	nInterfaceMethodTypeDescriptionCount == 0 );
-	OSL_ASSERT(	nInterfaceAttributeTypeDescriptionCount == 0 );
-	OSL_ASSERT(	nInterfaceTypeDescriptionCount == 0 );
-	OSL_ASSERT( nTypeDescriptionReferenceCount == 0 );
-
-	OSL_ASSERT( !pCallbacks || pCallbacks->empty() );
-#endif
 	delete pCallbacks;
 	pCallbacks = 0;
 

desktop/source/app/app.cxx

     else if( TypeToCopy == +1 ) // Folder
     {
         osl::Directory aDir( srcUnqPath );
-        aDir.open();
+        err = aDir.open();
+        if ( err != osl::FileBase::E_None )
+            return err;
 
         err = osl::Directory::create( dstUnqPath );
         osl::FileBase::RC next = err;

desktop/source/deployment/manager/dp_manager.cxx

 #include "com/sun/star/ucb/UnsupportedCommandException.hpp"
 #include "boost/bind.hpp"
 #include "tools/urlobj.hxx"
+#include "unotools/tempfile.hxx"
 
 #include "osl/file.hxx"
 #include <vector>
     ::ucbhelper::Content sourceContent(sourceContent_);
     Reference<XCommandEnvironment> xCmdEnv(
         sourceContent.getCommandEnvironment() );
-    OUString destFolder, tempEntry;
-    if (::osl::File::createTempFile(
-            m_activePackages_expanded.getLength() == 0
-            ? 0 : &m_activePackages_expanded,
-            0, &tempEntry ) != ::osl::File::E_None)
-        throw RuntimeException(
-            OUSTR("::osl::File::createTempFile() failed!"), 0 );
-    if (m_activePackages_expanded.getLength() == 0) {
-        destFolder = tempEntry;
-    }
-    else {
-        tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 );
-        // tweak user|share to macrofied url:
-        destFolder = makeURL( m_activePackages, tempEntry );
-    }
+
+    String baseDir(m_activePackages_expanded);
+    ::utl::TempFile aTemp(&baseDir, sal_False);
+    OUString tempEntry = aTemp.GetURL();
+    tempEntry = tempEntry.copy(tempEntry.lastIndexOf('/') + 1);
+    OUString destFolder = makeURL( m_activePackages, tempEntry);
     destFolder += OUSTR("_");
     
     // prepare activation folder:

desktop/source/deployment/registry/dp_backend.cxx

 #include "com/sun/star/beans/StringPair.hpp"
 #include "com/sun/star/sdbc/XResultSet.hpp"
 #include "com/sun/star/sdbc/XRow.hpp"
+#include "unotools/tempfile.hxx"
 
 
 using namespace ::dp_misc;
     OUString const & relUrl,
     Reference<ucb::XCommandEnvironment> const & xCmdEnv)
 {
-    OUString sDataFolder = makeURL(getCachePath(), relUrl);
+    const OUString sDataFolder = makeURL(getCachePath(), relUrl);
     //make sure the folder exist
     ucbhelper::Content dataContent;
     ::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv);
     
-    OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder);
-
-    OUString tempEntry;
-    if (::osl::File::createTempFile(
-            &sDataFolderURL, 0, &tempEntry ) != ::osl::File::E_None)
-        throw RuntimeException(
-            OUSTR("::osl::File::createTempFile() failed!"), 0 );
-    tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 );
-    OUString destFolder= makeURL(sDataFolder, tempEntry) + OUSTR("_");
-    ::ucbhelper::Content destFolderContent;
-    dp_misc::create_folder( &destFolderContent, destFolder, xCmdEnv );
-
-    return destFolder;
+    const OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder);
+    const String baseDir(sDataFolder);
+    const ::utl::TempFile aTemp(&baseDir, sal_True);
+    const OUString url = aTemp.GetURL();
+    return sDataFolder + url.copy(url.lastIndexOf('/'));
 }
 
+//folderURL can have the extension .tmp or .tmp_
+//Before OOo 3.4 the created a tmp file with osl_createTempFile and
+//then created a Folder with a same name and a trailing '_'
+//If the folderURL has no '_' then there is no corresponding tmp file.
 void PackageRegistryBackend::deleteTempFolder(
     OUString const & folderUrl)
 {
-    OSL_ASSERT(folderUrl.getLength()
-               && folderUrl[folderUrl.getLength() - 1] == '_');
-    if (folderUrl.getLength()
-               && folderUrl[folderUrl.getLength() - 1] == '_')
+    if (folderUrl.getLength())
     {
-        const OUString  tempFile = folderUrl.copy(0, folderUrl.getLength() - 1);
         erase_path( folderUrl, Reference<XCommandEnvironment>(),
                     false /* no throw: ignore errors */ );
-        erase_path( tempFile, Reference<XCommandEnvironment>(),
-                    false /* no throw: ignore errors */ );
+
+        if (folderUrl[folderUrl.getLength() - 1] == '_')
+        {
+            const OUString  tempFile = folderUrl.copy(0, folderUrl.getLength() - 1);
+            erase_path( tempFile, Reference<XCommandEnvironment>(),
+                        false /* no throw: ignore errors */ );
+        }
     }
 }
 
+//usedFolders can contain folder names which have the extension .tmp or .tmp_
+//Before OOo 3.4 we created a tmp file with osl_createTempFile and
+//then created a Folder with a same name and a trailing '_'
+//If the folderURL has no '_' then there is no corresponding tmp file.
 void PackageRegistryBackend::deleteUnusedFolders(
     OUString const & relUrl,
     ::std::list< OUString> const & usedFolders)
         Reference<sdbc::XResultSet> xResultSet(
             tempFolder.createCursor(
                 Sequence<OUString>( &StrTitle::get(), 1 ),
-                ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) );
+                ::ucbhelper::INCLUDE_FOLDERS_ONLY ) );
         // get all temp directories:
         ::std::vector<OUString> tempEntries;
 
         char tmp[] = ".tmp";
 
+        //Check for ".tmp_" can be removed after OOo 4.0
+        char tmp_[] = ".tmp_";
         while (xResultSet->next())
         {
             OUString title(
                     xResultSet, UNO_QUERY_THROW )->getString(
                         1 /* Title */ ) );
 
-            if (title.endsWithAsciiL(tmp, sizeof(tmp) - 1))
+            if (title.endsWithAsciiL(tmp, sizeof(tmp) - 1)
+                || title.endsWithAsciiL(tmp_, sizeof(tmp_) - 1))
                 tempEntries.push_back(
                     makeURLAppendSysPathSegment(sDataFolder, title));
         }
 
         for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos )
         {
-            //usedFolders contains the urls to the folders which have
-            //a trailing underscore
-            const OUString tempFolderName = tempEntries[ pos ] + OUSTR("_");
-
-            if (::std::find( usedFolders.begin(), usedFolders.end(), tempFolderName ) ==
+            if (::std::find( usedFolders.begin(), usedFolders.end(), tempEntries[pos] ) ==
                 usedFolders.end())
             {
-                deleteTempFolder(tempFolderName);
+                deleteTempFolder(tempEntries[pos]);
             }
         }
     }

desktop/source/deployment/registry/dp_backenddb.cxx

         ::osl::File::RC err = ::osl::DirectoryItem::get(m_urlDb, item);
         if (err == ::osl::File::E_None)
         {
-            m_doc = xDocBuilder->parseURI(m_urlDb);
+            ::ucbhelper::Content descContent(
+                m_urlDb, css::uno::Reference<css::ucb::XCommandEnvironment>());
+            Reference<css::io::XInputStream> xIn = descContent.openStream();
+            m_doc = xDocBuilder->parse(xIn);
         }
         else if (err == ::osl::File::E_NOENT)
         {

extensions/source/plugin/unx/sysplug.cxx

         int status = 16777216;
         pid_t nExit = waitpid( m_nCommPID, &status, WUNTRACED );
 #if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "child %d (plugin app child %d) exited with status %d\n", nExit, m_nCommPID, WEXITSTATUS(status) );
+        fprintf( stderr, "child %d (plugin app child %d) exited with status %d\n", (int)nExit, (int)m_nCommPID, (int)WEXITSTATUS(status) );
 #else
         (void)nExit;
 #endif

framework/source/services/backingwindow.cxx

 
 void BackingWindow::initBackground()
 {
-    SetBackground( GetSettings().GetStyleSettings().GetWorkspaceGradient() );
+    SetBackground();
 
     bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode();
     if( bDark )
 
 void BackingWindow::Paint( const Rectangle& )
 {
+    Wallpaper aBack( GetSettings().GetStyleSettings().GetWorkspaceGradient() );
+    Region aClip( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
+    Rectangle aBmpRect(maControlRect);
+    aBmpRect.Left()   -= nShadowLeft;
+    aBmpRect.Top()    -= nShadowTop;
+    aBmpRect.Right()  += nShadowRight;
+    aBmpRect.Bottom() += nShadowBottom;
+    aClip.Exclude( aBmpRect );
+    Push( PUSH_CLIPREGION );
+    IntersectClipRegion( aClip );
+    DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack );
+    Pop();
+    
+    VirtualDevice aDev( *this );
+    aDev.EnableRTL( IsRTLEnabled() );
+    aDev.SetOutputSizePixel( aBmpRect.GetSize() );
+    Point aOffset( Point( 0, 0 ) - aBmpRect.TopLeft() );
+    aDev.DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack );
 
     // draw bitmap
-    if( GetSettings().GetLayoutRTL() )
+    Point aTL( 0, 0 );
+    aDev.DrawBitmapEx( aTL, maBackgroundLeft );
+    aTL.X() += maBackgroundLeft.GetSizePixel().Width();
+    if( !!maBackgroundMiddle )
     {
-        Point aTL( maControlRect.TopLeft() );
-        aTL.X() -= nShadowRight;
-        aTL.Y() -= nShadowTop;
-        DrawBitmapEx( aTL, maBackgroundLeft );
-        aTL.X() += maBackgroundLeft.GetSizePixel().Width();
-        if( !!maBackgroundMiddle )
-        {
-            DrawBitmapEx( aTL, maBackgroundMiddle );
-            aTL.X() += maBackgroundMiddle.GetSizePixel().Width();
-        }
-        DrawBitmapEx( aTL, maBackgroundRight );
+        aDev.DrawBitmapEx( aTL, maBackgroundMiddle );
+        aTL.X() += maBackgroundMiddle.GetSizePixel().Width();
     }
-    else
-    {
-        Point aTL( maControlRect.TopLeft() );
-        aTL.X() -= nShadowLeft;
-        aTL.Y() -= nShadowTop;
-        DrawBitmapEx( aTL, maBackgroundLeft );
-        aTL.X() += maBackgroundLeft.GetSizePixel().Width();
-        if( !!maBackgroundMiddle )
-        {
-            DrawBitmapEx( aTL, maBackgroundMiddle );
-            aTL.X() += maBackgroundMiddle.GetSizePixel().Width();
-        }
-        DrawBitmapEx( aTL, maBackgroundRight );
-    }
+    aDev.DrawBitmapEx( aTL, maBackgroundRight );
+    
+    DrawOutDev( aBmpRect.TopLeft(), aBmpRect.GetSize(),
+                Point( 0, 0 ), aBmpRect.GetSize(),
+                aDev );
 }
 
 long BackingWindow::Notify( NotifyEvent& rNEvt )

framework/source/services/substitutepathvars.cxx

     }
 
     aState = utl::Bootstrap::locateUserData( sVal );
+    //There can be the valid case that there is no user installation. For example, "unopkg sync"
+    //is currently (OOo3.4) run as part of the setup. Then no user installation is required.
+    //Therefore we do not assert here.
     if( aState == ::utl::Bootstrap::PATH_EXISTS ) {
         aPreDefPathVariables.m_FixedVar[ PREDEFVAR_USERPATH ] = ConvertOSLtoUCBURL( sVal );
     }
-    else {
-        LOG_ERROR( "SubstitutePathVariables::SetPredefinedPathVariables", "Bootstrap code has no value for userpath");
-    }
 
     // Set $(inst), $(instpath), $(insturl)
     aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTURL ]    = aPreDefPathVariables.m_FixedVar[ PREDEFVAR_INSTPATH ];

graphite/makefile.mk

 # make use of stlport headerfiles
 EXT_USE_STLPORT=TRUE
 BUILD_ACTION=nmake VERBOSE=1
-.IF "$(debug)"=="true"
+.IF "x$(debug)"!="x"
 BUILD_FLAGS= "CFG=DEBUG"
 CFLAGSWITHPATH= $(CFLAGS:s!-Fd.!-Fd../../../../../!)
 .ELSE
 .IF "$(COM)"=="GCC"
 
 # Does linux want --disable-shared?
-.IF "$(debug)"=="true"
+.IF "x$(debug)"!="x"
 GR_CONFIGURE_FLAGS= --enable-debug=yes --disable-final --enable-static --disable-shared
 .ELSE
 GR_CONFIGURE_FLAGS= --enable-final=yes --enable-static --disable-shared
 
 .IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
 #OUT2LIB=win32$/bin.msvc$/*.lib
-.IF "$(debug)"=="true"
+.IF "x$(debug)"!="x"
 OUT2LIB=engine$/debug$/*.lib
 .ELSE
 OUT2LIB=engine$/release$/*.lib
 .ELSE
 .IF "$(OS)"=="WNT" && "$(COM)"!="GCC"
 #OUT2LIB+=engine$/src$/.libs$/libgraphite*.dll
-.IF "$(debug)"=="true"
+.IF "x$(debug)"!="x"
 OUT2BIN= \
 #    engine$/debug$/*.dll \
     engine$/debug$/*.pdb

i18npool/source/paper/paper.cxx

 
 static const size_t nTabSize = sizeof(aDinTab) / sizeof(aDinTab[0]);
 
-#define MAXSLOPPY 11
+#define MAXSLOPPY 21
 
 bool PaperInfo::doSloppyFit()
 {

l10ntools/source/help/HelpCompiler.hxx

             HCDBG(std::cerr << "native_file_string is " << tmp.getStr() << std::endl);
             return std::string(tmp.getStr());
         }
+#ifdef WNT
+        wchar_t const * native_file_string_w() const
+        {
+            ::rtl::OUString ustrSystemPath;
+            osl::File::getSystemPathFromFileURL(data, ustrSystemPath);
+            return ustrSystemPath.getStr();
+        }
+#endif
         std::string native_directory_string() const { return native_file_string(); }
         std::string toUTF8() const
         {

l10ntools/source/help/HelpIndexerTool.java

 import java.io.IOException;
 import java.util.Date;
 
+
+/**
+   When this tool is used with long path names on Windows, that is paths which start
+   with \\?\, then the caller must make sure that the path is unique. This is achieved
+   by removing '.' and '..' from the path. Paths which are created by
+   osl_getSystemPathFromFileURL fulfill this requirement. This is necessary because
+   lucene is patched to not use File.getCanonicalPath. See long_path.patch in the lucene
+   module.
+ */
 public class HelpIndexerTool
 {
     public HelpIndexerTool()

l10ntools/source/help/HelpLinker.cxx

         {
             fs::path fsCaptionPureTextFile_docURL = m_fsCaptionFilesDirName / aStdStr_EncodedDocPathURL;
             std::string aCaptionPureTextFileStr_docURL = fsCaptionPureTextFile_docURL.native_file_string();
-            FILE* pFile_docURL = fopen( aCaptionPureTextFileStr_docURL.c_str(), "w" );
+#ifdef WNT     //We need _wfopen to support long file paths on Windows XP
+            FILE* pFile_docURL = _wfopen(
+                fsCaptionPureTextFile_docURL.native_file_string_w(), L"w" );
+#else            
+            FILE* pFile_docURL = fopen(
+                fsCaptionPureTextFile_docURL.native_file_string().c_str(), "w" );
+#endif            
             if( pFile_docURL )
             {
                 fprintf( pFile_docURL, "%s\n", pResNodeCaption->content );
         if( pResNodeContent )
         {
             fs::path fsContentPureTextFile_docURL = m_fsContentFilesDirName / aStdStr_EncodedDocPathURL;
-            std::string aContentPureTextFileStr_docURL = fsContentPureTextFile_docURL.native_file_string();
-            FILE* pFile_docURL = fopen( aContentPureTextFileStr_docURL.c_str(), "w" );
+#ifdef WNT     //We need _wfopen to support long file paths on Windows XP
+            FILE* pFile_docURL = _wfopen(
+                fsContentPureTextFile_docURL.native_file_string_w(), L"w" );
+#else            
+            FILE* pFile_docURL = fopen(
+                fsContentPureTextFile_docURL.native_file_string().c_str(), "w" );
+#endif            
             if( pFile_docURL )
             {
                 fprintf( pFile_docURL, "%s\n", pResNodeContent->content );
         }
     }
 
-    void dump_DBHelp( const std::string& rFileName )
+    void dump_DBHelp( const fs::path& rFileName )
     {
-        FILE* pFile = fopen( rFileName.c_str(), "wb" );
+#ifdef WNT     //We need _wfopen to support long file paths on Windows XP
+        FILE* pFile = _wfopen( rFileName.native_file_string_w(), L"wb" );
+#else        
+        FILE* pFile = fopen( rFileName.native_file_string().c_str(), "wb" );
+#endif        
         if( pFile == NULL )
             return;
 
 #endif
 
     fs::path helpTextFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".ht_" : ".ht")));
+#ifdef WNT
+    //We need _wfopen to support long file paths on Windows XP
+    FILE* pFileHelpText_DBHelp = _wfopen
+        ( helpTextFileName_DBHelp.native_file_string_w(), L"wb" );
+#else
+    
     FILE* pFileHelpText_DBHelp = fopen
         ( helpTextFileName_DBHelp.native_file_string().c_str(), "wb" );
-
+#endif
     DB* dbBase(0);
 #ifndef DBHELP_ONLY
     fs::path dbBaseFileName(indexDirParentName / (mod + ".db"));
 #endif
 
     fs::path dbBaseFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".db_" : ".db")));
+#ifdef WNT
+    //We need _wfopen to support long file paths on Windows XP
+    FILE* pFileDbBase_DBHelp = _wfopen
+        ( dbBaseFileName_DBHelp.native_file_string_w(), L"wb" );
+#else    
     FILE* pFileDbBase_DBHelp = fopen
         ( dbBaseFileName_DBHelp.native_file_string().c_str(), "wb" );
+#endif    
 
 #ifndef DBHELP_ONLY
     DB* keyWord(0);
     if( pFileDbBase_DBHelp != NULL )
         fclose( pFileDbBase_DBHelp );
 
-    helpKeyword.dump_DBHelp( keyWordFileName_DBHelp.native_file_string() );
+    helpKeyword.dump_DBHelp( keyWordFileName_DBHelp);
 
     if( !bExtensionMode )
     {

libxml2/libxml2-long-path.patch

+--- misc/libxml2-2.7.6/uri.c	2009-10-02 17:28:55.000000000 +0200
++++ misc/build/libxml2-2.7.6/uri.c	2011-02-24 13:47:19.349299000 +0100
+@@ -2479,7 +2479,16 @@
+     if (path == NULL)
+ 	return(NULL);
+ 
+-    /* sanitize filename starting with // so it can be used as URI */
++#if defined(_WIN32) 	
++	//We must not change the backslashes to slashes if the the path starts with
++	// \\?\
++	//Those pathes can be up to 32k characters long.
++	len = xmlStrlen(path);
++	if ((len > 3) && (path[0] == '\\') && (path[1] == '\\') && (path[2] == '?') && (path[3] == '\\') )
++		return xmlStrdup((const xmlChar *) path);
++#endif
++
++	/* sanitize filename starting with // so it can be used as URI */
+     if ((path[0] == '/') && (path[1] == '/') && (path[2] != '/'))
+         path++;
+ 
+--- misc/libxml2-2.7.6/xmlIO.c	2009-09-24 17:32:00.000000000 +0200
++++ misc/build/libxml2-2.7.6/xmlIO.c	2011-02-24 13:47:26.163762000 +0100
+@@ -772,6 +772,11 @@
+ 
+ #ifdef HAVE_STAT
+ #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
++	//On Windows stat and wstat do not work with long pathname, 
++	//which start with '\\?\'
++	if ((xmlStrlen(path) > 3) && (path[0] == '\\') && (path[1] == '\\') && (path[2] == '?') && (path[3] == '\\') )
++		return 1;
++
+     if (xmlWrapStat(path, &stat_buffer) == -1)
+         return 0;
+ #else

libxml2/makefile.mk

             libxml2-xpath.patch \
             libxml2-global-symbols.patch \
 
+.IF "$(OS)" == "WNT"
+PATCH_FILES+= libxml2-long-path.patch
+.ENDIF
 
 # This is only for UNX environment now
 

lucene/long_path.patch

+--- misc/lucene-2.3.2/src/java/org/apache/lucene/store/FSDirectory.java	2008-05-01 22:27:58.000000000 +0200
++++ misc/build/lucene-2.3.2/src/java/org/apache/lucene/store/FSDirectory.java	2011-02-23 16:36:26.249515000 +0100
+@@ -165,7 +165,15 @@
+   public static FSDirectory getDirectory(File file, LockFactory lockFactory)
+     throws IOException
+   {
+-    file = new File(file.getCanonicalPath());
++      String path = file.getPath();
++      //File.getCanonicalPath fails on Windows with long path names
++      //Tested with Java SE 6u23
++      //Long path names created by osl_getSystemPathFromFileURL are already
++      //unique because its implementation replaces the occurrences of .. and .
++      //That is using the com.sun.star.help.HelpIndexer service from c++ is
++      //relatively safe.
++      if (!path.startsWith("\\\\?\\"))
++          file = new File(file.getCanonicalPath());
+ 
+     if (file.exists() && !file.isDirectory())
+       throw new IOException(file + " not a directory");
+@@ -455,7 +463,16 @@
+   public String getLockID() {
+     String dirName;                               // name to be hashed
+     try {
+-      dirName = directory.getCanonicalPath();
++        //File.getCanonicalPath fails on Windows with long path names
++        //Tested with Java SE 6u23
++        //Long path names created by osl_getSystemPathFromFileURL are already
++        //unique because its implementation replaces the occurrences of .. and .
++        //That is using the com.sun.star.help.HelpIndexer service from c++ is
++        //relatively safe.
++        if (!directory.getPath().startsWith("\\\\?\\"))
++            dirName = directory.getCanonicalPath();
++        else
++            dirName = directory.getPath();
+     } catch (IOException e) {
+       throw new RuntimeException(e.toString(), e);
+     }

lucene/makefile.mk

 
 TARFILE_NAME=$(LUCENE_NAME)
 TARFILE_MD5=48d8169acc35f97e05d8dcdfd45be7f2
-PATCH_FILES=lucene.patch
+PATCH_FILES=lucene.patch 
+
+.IF "$(OS)" == "WNT"
+PATCH_FILES+= long_path.patch
+.ENDIF
+
 
 BUILD_DIR=.
 BUILD_ACTION= ${ANT} -buildfile .$/contrib$/analyzers$/build.xml
 mkdir: %_DEST%\lib%_EXT%\python\lib-tk